|
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.meta.MetaDefinition
tv.amwa.maj.meta.TypeDefinition
tv.amwa.maj.meta.TypeDefinitionEnumeration
@AAFClass(uuid1=218169601, uuid2=519, uuid3=0, uuid4={6,14,43,52,2,6,1,1}, definedName="TypeDefinitionEnumeration", description="The TypeDefinitionEnumeration class defines a property type that can have one of a set of integer values.") public final class TypeDefinitionEnumeration
Implements the definition of a property type that can have one of a set of integer values.
THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.
Nested Class Summary | |
---|---|
static class |
TypeDefinitionEnumeration.EnumerationValue
|
static class |
TypeDefinitionEnumeration.XMLHandler
|
Constructor Summary | |
---|---|
TypeDefinitionEnumeration(AUID identification,
String typeName,
Class<?> enumeration)
Creates and initializes an enumeration type definition, which defines a property type that can have one of a set of integer values. |
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. |
int |
countElements()
Returns the number of enumeration elements contained in the list of elements of this enumeration type definition. |
PropertyValue |
createValue(Object javaValue)
Create a property value from the given Java object. |
PropertyValue |
createValueFromName(String name)
Creates and returns an enumeration property value of this enumeration type using the given enumeration element name. |
boolean |
deepEquals(Object o)
Check to see if this definition is equal to the given object by comparing each property. |
String |
getElementName(int index)
Returns the name of the enumeration element at the given index into the list of elements of this enumeration type definition. |
String[] |
getElementNames()
|
TypeDefinition |
getElementType()
Returns the type definition of the integer values that are found in this enumeration. |
long |
getElementValue(int index)
Returns the integer value associated with the enumeration element at the given index in the list of elements of this enumeration type definition. |
long[] |
getElementValues()
|
Class<Enum<?>> |
getEnumeration()
Returns the Enum Java type associated with
this enumeration type definition. |
long |
getIntegerValue(PropertyValue enumerationProperty)
Returns the integer value associated with the given enumeration property value as defined by this enumeration type definition. |
String |
getNameFromInteger(long value)
Returns the name element with the given integer in this enumeration type definition. |
String |
getNameFromValue(PropertyValue enumerationProperty)
Returns the name associated with the given enumeration property value as defined by this enumeration type definition. |
TypeCategory |
getTypeCategory()
Returns the type category to which this type definition belongs, which corresponds to its sub interface. |
void |
setPropertiesFromInterface(TypeDefinitionEnumeration castFrom)
|
Methods inherited from class tv.amwa.maj.meta.TypeDefinition |
---|
setPropertiesFromInterface |
Methods inherited from class tv.amwa.maj.meta.MetaDefinition |
---|
castFromInterface, equals, getAUID, getDescription, getIdentification, getName, hashCode, setDescription, setName, setPropertiesFromInterface, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface tv.amwa.maj.iface.MetaDefinition |
---|
getAUID, getDescription, getName, setDescription, setName |
Methods inherited from interface tv.amwa.maj.meta.MAJCommon |
---|
equals, hashCode, toString |
Field Detail |
---|
public static final TypeDefinitionEnumeration Boolean
public static final TypeDefinitionEnumeration ProductReleaseType
public static final TypeDefinitionEnumeration TapeFormatType
public static final TypeDefinitionEnumeration VideoSignalType
public static final TypeDefinitionEnumeration TapeCaseType
public static final TypeDefinitionEnumeration ColorSitingType
public static final TypeDefinitionEnumeration EditHintType
public static final TypeDefinitionEnumeration FadeType
public static final TypeDefinitionEnumeration TCSource
public static final TypeDefinitionEnumeration TimecodeSource
public static final TypeDefinitionEnumeration PulldownDirectionType
public static final TypeDefinitionEnumeration PulldownKindType
public static final TypeDefinitionEnumeration EdgeType
public static final TypeDefinitionEnumeration FilmType
public static final TypeDefinitionEnumeration RGBAComponentKind
public static final TypeDefinitionEnumeration ReferenceType
public static final TypeDefinitionEnumeration AlphaTransparencyType
public static final TypeDefinitionEnumeration FieldNumber
public static final TypeDefinitionEnumeration ElectoSpatialFormulation
public static final TypeDefinitionEnumeration SignalStandardType
public static final TypeDefinitionEnumeration ScanningDirectionType
public static final TypeDefinitionEnumeration LayoutType
public static final TypeDefinitionEnumeration EmphasisType
public static final TypeDefinitionEnumeration AuxBitsModeType
public static final TypeDefinitionEnumeration ChannelStatusModeType
public static final TypeDefinitionEnumeration UserDataModeType
public static final TypeDefinitionEnumeration ContentScanningType
Constructor Detail |
---|
public TypeDefinitionEnumeration(AUID identification, @AAFString String typeName, Class<?> enumeration) throws NullPointerException, IllegalArgumentException
Creates and initializes an enumeration type definition, which defines a
property type that can have one of a set of integer values. The enumeration is
initialized with its identity and its enumeration elements defined by a
java.lang.Enum
class (Class<Enum>
).
The interface AAFEnumerationValue
must
be implemented by the Java class defining the enumeration. For any enumeration value,
this interface provides a method
value()
that is
used to find the Int64
value associated with the enumeration token in
the AAF object specification and associated registries. Note, however, that Java
enumeration values are backed by Java int
values that are actually
Int32
AAF values.
Creating new and unregistered type definitions is not recommended as this may cause
interoperability issues with other systems. The official registry of type definitions
is available from SMPTE at SMPTE Metadata Registries
And Related Items. The full range of data types documented in the AAF 1.1 object
specification can be accessed by name and identification using either
AAFFactory.typeDefinitionForName(String)
or
AAFFactory.typeDefinitionForIdentification(tv.amwa.maj.record.AUID)
respectively.
identification
- Unique indentifier to be used to identify this type.typeName
- Display name for the enumeration type definition.enumeration
- Java enumeration represented by this type definition.
NullPointerException
- One or more of the arguments is null,
or one or more of the elements of the names array is null.
IllegalArgumentException
- The class provided to describe this
enumeration is not a Java enumeration or does not implement the
AAFEnumerationValue
interface.Method Detail |
---|
public final void setPropertiesFromInterface(TypeDefinitionEnumeration castFrom)
MetaDefinition.setPropertiesFromInterface(tv.amwa.maj.iface.MetaDefinition)
public int countElements()
TypeDefinitionEnumeration
Returns the number of enumeration elements contained in the list of elements of this enumeration type definition.
countElements
in interface TypeDefinitionEnumeration
public PropertyValue createValueFromName(String name) throws NullPointerException, InvalidParameterException
TypeDefinitionEnumeration
Creates and returns an enumeration property value of this enumeration type using the given enumeration element name.
createValueFromName
in interface TypeDefinitionEnumeration
name
- Name of an enumeration element to create a property value
for.
NullPointerException
- The given element name is null
.
InvalidParameterException
- The given name is not in the
list of element names for this enumeration type.public String getElementName(int index) throws IndexOutOfBoundsException
TypeDefinitionEnumeration
Returns the name of the enumeration element at the given index into the list of elements of this enumeration type definition.
getElementName
in interface TypeDefinitionEnumeration
index
- 0-based index of the name to retrieve from the list of elements
of this enumeration type definition.
IndexOutOfBoundsException
@AAFProperty(uuid1=100729095, uuid2=2816, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="ElementType", typeName="WeakReference to TypeDefinition", optional=false, uniqueIdentifier=false, pid=20) public TypeDefinition getElementType()
TypeDefinitionEnumeration
Returns the type definition of the integer
values that are found in this enumeration. For data types created using the MAJ API, this
is always an Int32
.
getElementType
in interface TypeDefinitionEnumeration
TypeDefinitionInteger
@AAFProperty(uuid1=50397699, uuid2=1024, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="ElementNames", typeName="StringArray", optional=false, uniqueIdentifier=false, pid=21) public String[] getElementNames()
@AAFProperty(uuid1=50397699, uuid2=1280, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="ElementValues", typeName="Int64Array", optional=false, uniqueIdentifier=false, pid=22) public long[] getElementValues()
public long getElementValue(int index) throws IndexOutOfBoundsException
TypeDefinitionEnumeration
Returns the integer value associated with the enumeration element at the given index in the list of elements of this enumeration type definition.
getElementValue
in interface TypeDefinitionEnumeration
index
- 0-based index of the integer value to retrieve from the list of elements of
this enumeration type definition.
IndexOutOfBoundsException
- The given index is outside the
acceptable range for the enumeration type definition.public Class<Enum<?>> getEnumeration()
TypeDefinitionEnumeration
Returns the Enum
Java type associated with
this enumeration type definition.
getEnumeration
in interface TypeDefinitionEnumeration
public long getIntegerValue(PropertyValue enumerationProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionEnumeration
Returns the integer value associated with the given enumeration property value as defined by this enumeration type definition.
getIntegerValue
in interface TypeDefinitionEnumeration
enumerationProperty
- Enumeration property value
to find the associated integer for.
NullPointerException
- The given enumeration property is
null
.
IllegalPropertyValueException
- The given property value is not
defined by the enumeration type definition.public String getNameFromInteger(long value) throws IllegalArgumentException
TypeDefinitionEnumeration
Returns the name element with the given integer in this enumeration type definition.
getNameFromInteger
in interface TypeDefinitionEnumeration
value
- Integer value associated with an enumeration
element.
IllegalArgumentException
public String getNameFromValue(PropertyValue enumerationProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionEnumeration
Returns the name associated with the given enumeration property value as defined by this enumeration type definition.
getNameFromValue
in interface TypeDefinitionEnumeration
enumerationProperty
- Enumeration property value to find the name of.
NullPointerException
- The given property value is null
.
IllegalPropertyValueException
- The given property value is not
a value of this enumeration property type.public PropertyValue createValue(Object javaValue) throws ClassCastException
TypeDefinition
Create a property value from the given Java object. If the type of
the object is not compatible with this type definition, a ClassCastException
is thrown.
createValue
in interface TypeDefinition
createValue
in class TypeDefinition
javaValue
- Java object to use to create a property value of this type.
ClassCastException
- The given object cannot be cast to a property value with
this type definition.public TypeCategory getTypeCategory()
TypeDefinition
Returns the type category to which this type definition belongs, which
corresponds to its sub interface. For example, TypeCategory.Int
is returned for a TypeDefinitionInteger
.
getTypeCategory
in interface TypeDefinition
getTypeCategory
in class TypeDefinition
TypeCategory
public final boolean deepEquals(Object o)
MetaDefinition
Check to see if this definition is equal to the given object by comparing each
property. The MetaDefinition.equals(Object)
method only checks that the identies of two
definitions are equal, relying on the unqiueness ensured by identity registration.
This method is provided for debugging and validation purposes.
deepEquals
in class MetaDefinition
o
- Object to compare to this definition.
public void appendXMLChildren(Node parent)
XMLSerializable
Append 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 XMLSerializable
appendXMLChildren
in class MetaDefinition
parent
- XML parent element to append child nodes to.
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |