|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objecttv.amwa.maj.embeddable.EdgecodeValue
public final class EdgecodeValue
Implementation of a value that represents film edge code information. The properties of an edgecode are specified by the AAF edgecode class.
The internal representation of the header is as a byte array. Conversion to and from Java String values
can take place using setHeaderFromString(String) and getHeaderAsString().
An edgecode value can be represented in a database by the following columns:
`CodeFormat` int(11) NOT NULL,
`FilmKind` int(11) NOT NULL,
`StartFrame` bigint(20) NOT NULL,
`Header` tinyblob
EdgecodeSegment,
EdgecodeHeader,
Serialized Form| Field Summary | |
|---|---|
static String |
CODEFORMAT_TAG
|
static String |
FILMKIND_TAG
|
static String |
HEADER_TAG
|
static String |
START_TAG
|
| Constructor Summary | |
|---|---|
EdgecodeValue()
Create a default edgecode value. |
|
EdgecodeValue(long startFrame,
FilmType filmKind,
EdgeType codeFormat)
Creates and initializes a new edgecode value. |
|
| Method Summary | |
|---|---|
void |
appendXMLChildren(Node parent)
Append child elements to the given parent node to serialize the value of an object to an XML fragment. |
void |
appendXMLGrandchildren(Node edgecodeElement)
Appends the sub-elements of an XML representation of this value to the given XML node, without the enclosing EdgecodeValue tag. |
static EdgecodeValue |
castFromInterface(EdgecodeValue alien)
Create an instance of this edgecode value implementation using a possibly alien implementation that at least implements tv.amwa.maj.record.EdgecodeValue. |
EdgecodeValue |
clone()
Creates a cloned deep copy of this embeddable value. |
boolean |
equals(Object o)
Two edgecode values are equals if and only if each of their properties are equals. |
EdgeType |
getCodeFormat()
Returns the format of the edge code. |
FilmType |
getFilmKind()
Returns the film type of this edge code. |
byte[] |
getHeader()
Returns the text prefix that identifies the film. |
String |
getHeaderAsString()
Returns the value of the edge code header as a string. |
long |
getStartFrame()
Returns the edge code at the beginning of the corresponding segment. |
int |
hashCode()
Returns a hash code value for this embeddable object. |
void |
setCodeFormat(EdgeType codeFormat)
Sets the format of the edge code. |
void |
setFilmKind(FilmType filmKind)
Sets the type of film for this edge code. |
void |
setHeader(byte[] header)
Sets the text prefix that identifies the film. |
void |
setHeaderFromString(String header)
Set the value of the edge code header from the given string. |
void |
setPropertiesFromInterface(EdgecodeValue castFrom)
Set the properties of this value from those available in the given value, which is specified by the edgecode value interface. |
void |
setStartFrame(long startFrame)
Sets the edge code at the beginning of the corresponding segment. |
String |
toString()
Formats this edgecode value in a pseudo-XML representation that is compatible with the AAF XML schema. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String START_TAG
public static final String FILMKIND_TAG
public static final String CODEFORMAT_TAG
public static final String HEADER_TAG
| Constructor Detail |
|---|
public EdgecodeValue(@PositionType
long startFrame,
FilmType filmKind,
EdgeType codeFormat)
throws NullPointerException
Creates and initializes a new edgecode value.
startFrame - Specifies the edge code at the beginning of the corresponding segment.filmKind - Specifies the type of film.codeFormat - Specifies the edge code format.
NullPointerException - One or more of the arguments is/are null.public EdgecodeValue()
Create a default edgecode value. The newly created edgecode value has the following initial value:
<EdgecodeValue>
<EdgeCodeStart>0</EdgeCodeStart>
<FilmKind>FtNull</FilmKind>
<CodeFormat>EtNull</CodeFormat>
<!-- Header property is omitted -->
</EdgecodeValue>
| Method Detail |
|---|
public static final EdgecodeValue castFromInterface(EdgecodeValue alien)
throws NullPointerException
Create an instance of this edgecode value implementation using a possibly alien implementation that
at least implements tv.amwa.maj.record.EdgecodeValue. If
the given value is an instance of this class, the value is returned directly, otherwise a new edgecode
value is constructed with an equivalent value to the given value.
alien - Object implementing EdgecodeValue to
use to create an instance of this implementation from.
NullPointerException - The alien value argument is null.setPropertiesFromInterface(tv.amwa.maj.record.EdgecodeValue)public final void setPropertiesFromInterface(EdgecodeValue castFrom)
Set the properties of this value from those available in the given value, which is specified by the edgecode value interface.
castFrom - Value to extract properties from.
NullPointerException - The given value to use to set this value is null.castFromInterface(tv.amwa.maj.record.EdgecodeValue)public EdgeType getCodeFormat()
EdgecodeValueReturns the format of the edge code.
getCodeFormat in interface EdgecodeValue
public void setCodeFormat(EdgeType codeFormat)
throws NullPointerException
EdgecodeValueSets the format of the edge code.
setCodeFormat in interface EdgecodeValuecodeFormat - Format of the edge code.
NullPointerException - The given edge code format is null.public FilmType getFilmKind()
EdgecodeValueReturns the film type of this edge code.
getFilmKind in interface EdgecodeValue
public void setFilmKind(FilmType filmKind)
throws NullPointerException
EdgecodeValueSets the type of film for this edge code.
setFilmKind in interface EdgecodeValuefilmKind - Type of film for this edge code.
NullPointerException - The given film type for the edge code is null.
@EdgecodeHeader
public byte[] getHeader()
throws PropertyNotPresentException
EdgecodeValueReturns the text prefix that identifies the film. Typically, this is a text string of no more than 8 7-bit ISO characters. This is an optional property.
getHeader in interface EdgecodeValuePropertyNotPresentException - The optional header property is not present for this edgecode
value.getHeaderAsString()
public void setHeader(@EdgecodeHeader
byte[] header)
EdgecodeValueSets the text prefix that identifies the film. Typically, this is a text string of no
more than 8 7-bit ISO characters. Set the value to null to omit this
optoinal property.
To convert a String to an array of bytes, use
String.getBytes(String).
setHeader in interface EdgecodeValueheader - Text prefix that identifies the film.setHeaderFromString(String)
public String getHeaderAsString()
throws PropertyNotPresentException
Returns the value of the edge code header as a string. Conversion to bytes takes
place using the platforms default character set, using
String.String(byte[]).
PropertyNotPresentException - The optional header property is not present
in this edgecode value.getHeader()
public void setHeaderFromString(String header)
throws NullPointerException
Set the value of the edge code header from the given string. Conversion to bytes takes
place using the platforms default character set, according to
String.String(byte[]).
header - String representation of the edge code header.
NullPointerExceptionsetHeader(byte[])public long getStartFrame()
EdgecodeValueReturns the edge code at the beginning of the corresponding segment.
getStartFrame in interface EdgecodeValuepublic void setStartFrame(long startFrame)
EdgecodeValueSets the edge code at the beginning of the corresponding segment.
setStartFrame in interface EdgecodeValuestartFrame - Edge code the the beginning of the corresponding segment.public boolean equals(Object o)
Two edgecode values are equals if and only if each of their properties are equals.
equals in interface MAJCommonequals in class Objecto - Object to test for equality with.
Object.equals(java.lang.Object)public String toString()
Formats this edgecode value in a pseudo-XML representation that is compatible with the AAF XML schema. For example:
<EdgecodeValue>
<EdgeCodeStart>321</EdgeCodeStart>
<FilmKind>Ft35MM</FilmKind>
<CodeFormat>EtKeycode</CodeFormat>
<!--Header as text: 'abcdefgh'-->
<EdgeCodeHeader>6162636465666768</EdgeCodeHeader>
</EdgecodeValue>
toString in interface MAJCommontoString in class ObjectObject.toString()public EdgecodeValue clone()
MAJCommonCreates a cloned deep copy of this embeddable value. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.
This method does not throw a CloneNotSupportedException as all
embeddable values must implement the Cloneable interface.
clone in interface MAJCommonclone in class ObjectObject.clone()public int hashCode()
MAJCommonReturns a hash code value for this embeddable object.
hashCode in interface MAJCommonhashCode in class ObjectObject.hashCode()public void appendXMLChildren(Node parent)
XMLSerializableAppend child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder class are provided to help with this
process.
appendXMLChildren in interface XMLSerializableparent - XML parent element to append child nodes to.public void appendXMLGrandchildren(Node edgecodeElement)
Appends the sub-elements of an XML representation of this value to the given XML node, without
the enclosing EdgecodeValue tag. This allows the elements of an edgecode to be
appended to the XML representation of an edgecode
segment.
edgecodeElement - XML node to append start time, film kind, code format and header elements
to, which represent this value.
|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||