|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tv.amwa.maj.meta.MetaDefinition tv.amwa.maj.meta.TypeDefinition tv.amwa.maj.meta.TypeDefinitionFixedArray
@AAFClass(uuid1=218169601, uuid2=520, uuid3=0, uuid4={6,14,43,52,2,6,1,1}, definedName="TypeDefinitionFixedArray", description="The TypeDefinitionFixedArray class defines a property type that has a fixed number of values of the underlying type. The order of the values is meaningful.") public final class TypeDefinitionFixedArray
Implements the definition of a property type that has a fixed number of values of the underlying type. The order of the values is meaningful.
THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.
Nested Class Summary | |
---|---|
static class |
TypeDefinitionFixedArray.FixedArrayValue
|
static class |
TypeDefinitionFixedArray.XMLHandler
|
Field Summary | |
---|---|
static TypeDefinitionFixedArray |
RGBALayout
|
static TypeDefinitionFixedArray |
UInt8Array12
|
static TypeDefinitionFixedArray |
UInt8Array8
|
Constructor Summary | |
---|---|
TypeDefinitionFixedArray(AUID identification,
String typeName,
TypeDefinition elementType,
int numberElements)
Creates and initializes a new fixed array type definition, which defines a property type that has a fixed number of values of the underlying type. |
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. |
PropertyValue |
createValue(Object javaValue)
Create a property value from the given Java object. |
PropertyValue |
createValueFromArray(Object[] initData)
Creates and returns a new fixed array property value from the given Java array. |
PropertyValue |
createValueFromValues(PropertyValue[] elementValues)
Creates and returns a fixed array property value from the given array of property values. |
boolean |
deepEquals(Object o)
Check to see if this definition is equal to the given object by comparing each property. |
Object[] |
getArray(PropertyValue arrayProperty)
Returns a Java array created from the elements of the given fixed array property value. |
int |
getCount()
Returns the number of elements of an array defined by this fixed array type definition. |
List<PropertyValue> |
getElements(PropertyValue arrayProperty)
Returns a list over all the property values of the given fixed array property value. |
PropertyValue |
getElementValue(PropertyValue arrayProperty,
int index)
Returns the member property value at the given index through the given fixed array property value. |
TypeDefinition |
getType()
Returns the underlying type of that defines the type of each element of the array defined by this fixed array type definition. |
TypeCategory |
getTypeCategory()
Returns the type category to which this type definition belongs, which corresponds to its sub interface. |
void |
setArray(PropertyValue arrayProperty,
Object[] data)
Sets the value of the given fixed array property value using the given Java array, setting the elements of the fixed array to be values given by the elements of the Java array. |
void |
setElementValue(PropertyValue arrayProperty,
int index,
PropertyValue memberProperty)
Sets the value of a member of the given fixed array property value at the given index using the given value. |
void |
setPropertiesFromInterface(TypeDefinitionFixedArray 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 TypeDefinitionFixedArray UInt8Array8
public static final TypeDefinitionFixedArray UInt8Array12
public static final TypeDefinitionFixedArray RGBALayout
Constructor Detail |
---|
public TypeDefinitionFixedArray(AUID identification, @AAFString String typeName, TypeDefinition elementType, @UInt32 int numberElements) throws NullPointerException, IllegalArgumentException
Creates and initializes a new fixed array type definition, which defines a property type that has a fixed number of values of the underlying type. The order of the values is meaningful.
The following types are allowed as the underlying type for fixed array type definitions:
TypeDefinitionInteger
TypeDefinitionRecord
TypeDefinitionEnumeration
TypeDefinitionExtendibleEnumeration
TypeDefinitionFixedArray
If the element type is not one of the above kinds, an IllegalArgumentException
is
thrown.
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
- AUID to be used to identify this type.elementType
- Type of each element to be contained in an array defined
by the fixed array type definition.numberElements
- Number of elements of this kind of array.typeName
- Friendly name of the fixed array type definition.
NullPointerException
- One or more of the arguments is null.
IllegalArgumentException
- The given underlying type is not compatible
with the types supported by fixed size arrays.Method Detail |
---|
public final void setPropertiesFromInterface(TypeDefinitionFixedArray castFrom)
MetaDefinition.setPropertiesFromInterface(tv.amwa.maj.iface.MetaDefinition)
public PropertyValue createValueFromValues(PropertyValue[] elementValues) throws NullPointerException, BadParameterException, BadTypeException
TypeDefinitionFixedArray
Creates and returns a fixed array property value from the given array of property values.
createValueFromValues
in interface TypeDefinitionFixedArray
elementValues
- Property value array to use to initialize the new
fixed array property value.
NullPointerException
- The given array of element values is null
or
one or more of its elements is null
.
BadParameterException
- The given array of property values is
of a different size to that required by the fixed array type definition,
as returned by TypeDefinitionFixedArray.getCount()
.
BadTypeException
- One or more of the elements of the given
property value array cannot be converted to values of the underlying type
of the fixed type array definition, as returned by TypeDefinitionFixedArray.getType()
.@AAFProperty(uuid1=50397699, uuid2=768, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="ElementCount", typeName="UInt32", optional=false, uniqueIdentifier=false, pid=24) public int getCount()
TypeDefinitionFixedArray
Returns the number of elements of an array defined by this fixed array type definition.
getCount
in interface TypeDefinitionFixedArray
public PropertyValue getElementValue(PropertyValue arrayProperty, int index) throws NullPointerException, IndexOutOfBoundsException, IllegalPropertyValueException
TypeDefinitionFixedArray
Returns the member property value at the given index through the given fixed array property value.
getElementValue
in interface TypeDefinitionFixedArray
arrayProperty
- Fixed array property value to retrieve a
a member property value from.index
- 0-based index into the given fixed array property value
to use to locate the required member property value.
NullPointerException
- The given fixed array property value is null
.
IndexOutOfBoundsException
- The given index is outside
the acceptable range for an array defined by this fixed array
type definition.
IllegalPropertyValueException
- The fixed array property value is not
defined by this fixed array type definition.public List<PropertyValue> getElements(PropertyValue arrayProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionFixedArray
Returns a list over all the property values of the given fixed array property value.
getElements
in interface TypeDefinitionFixedArray
arrayProperty
- Fixed array property value to create
a list from.
NullPointerException
- The given fixed array property
value is null
.
IllegalPropertyValueException
- The given property value is
not defined by this fixed array type definition.TypeDefinitionFixedArray.getArray(PropertyValue)
,
TypeDefinitionFixedArray.getElementValue(PropertyValue, int)
public Object[] getArray(PropertyValue arrayProperty) throws NullPointerException, IllegalPropertyValueException
TypeDefinitionFixedArray
Returns a Java array created from the elements of the
given fixed array property value. The array is created with
a call to PropertyValue.getValue()
on each of the
members of the given array.
getArray
in interface TypeDefinitionFixedArray
arrayProperty
- Fixed array property value to create a
fixed array property value from.
NullPointerException
- Argument is null.
IllegalPropertyValueException
- The fixed array property value is not
defined by the fixed array type definition.TypeDefinitionFixedArray.createValueFromArray(Object[])
,
TypeDefinitionFixedArray.getElements(PropertyValue)
@AAFProperty(uuid1=100729095, uuid2=3072, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="ElementType", typeName="WeakReference to TypeDefinition", optional=false, uniqueIdentifier=false, pid=23) public TypeDefinition getType()
TypeDefinitionFixedArray
Returns the underlying type of that defines the type of each element of the array defined by this fixed array type definition.
getType
in interface TypeDefinitionFixedArray
public void setElementValue(PropertyValue arrayProperty, int index, PropertyValue memberProperty) throws NullPointerException, IllegalPropertyValueException, IndexOutOfBoundsException, BadTypeException
TypeDefinitionFixedArray
Sets the value of a member of the given fixed array property value at the given index using the given value.
setElementValue
in interface TypeDefinitionFixedArray
arrayProperty
- Fixed array property value for which a member
is to be set.index
- 0-based index of the member value to change.memberProperty
- Replacement value for the member of the given
array at the given index.
NullPointerException
- One or both of the array and/or member property
values is/are null
.
IllegalPropertyValueException
- The fixed array property value is not
defined by this fixed array type definition.
IndexOutOfBoundsException
- The index is outside the acceptable
range for arrays of this fixed array type definition.
BadTypeException
- The given member property definition is
not compatible with the underlying type of the fixed array type
definition, as returned by TypeDefinitionFixedArray.getType()
.TypeDefinitionFixedArray.getElements(PropertyValue)
public void setArray(PropertyValue arrayProperty, Object[] data) throws NullPointerException, IllegalPropertyValueException, BadParameterException, BadTypeException
TypeDefinitionFixedArray
Sets the value of the given fixed array property value using
the given Java array, setting the elements of the fixed array
to be values given by the elements of the Java array. Both arrays
must the same length and it must be possible to convert the
values of the Java array to the underlying type of the fixed
array type definition, as returned by TypeDefinitionFixedArray.getType()
and using
TypeDefinition.createValue(Object)
.
setArray
in interface TypeDefinitionFixedArray
arrayProperty
- Fixed array property value to have the value
of all of its elements set.data
- Java array containing elements to be used to set the
values of the elements of the given fixed array property value.
NullPointerException
- One or more of the arguments is null,
or one or more of the elements of the given Java array is null.
IllegalPropertyValueException
- The fixed array property value is not
defined by the fixed array type definition.
BadParameterException
- The given Java array is a different
size to that defined by the fixed array type definition, as returned
by TypeDefinitionFixedArray.getCount()
.
BadTypeException
- The Java array contains one or more
objects that cannot be converted to elements of the underlying type
of this fixed array type definition, as returned by TypeDefinitionFixedArray.getType()
.TypeDefinitionFixedArray.createValueFromArray(Object[])
,
TypeDefinition.createValue(Object)
public PropertyValue createValueFromArray(Object[] initData) throws NullPointerException, BadParameterException, BadTypeException
TypeDefinitionFixedArray
Creates and returns a new fixed array property value from
the given Java array. The elements of the Java array are converted
to property values of the underlying type of the fixed array
type definition, as returned by TypeDefinitionFixedArray.getType()
and using a
call to TypeDefinition.createValue(Object)
.
createValueFromArray
in interface TypeDefinitionFixedArray
initData
- Java array of data to use to initialize the new
fixed array property value.
NullPointerException
- The argument is null
, or one or more of
the elements of the given Java array are null
.
BadParameterException
- The given Java array is of a different
size to that required by the fixed array type definition, as returned
by TypeDefinitionFixedArray.getCount()
.
BadTypeException
- One or more of the elements of the given
Java array cannot be converted to values of the underlying type of the
fixed type array definition, as returned by TypeDefinitionFixedArray.getType()
.TypeDefinition.createValue(Object)
,
TypeDefinitionFixedArray.getArray(PropertyValue)
,
TypeDefinitionFixedArray.setArray(PropertyValue, Object[])
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 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 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 |