|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeDefinitionFixedArray
Specifies the definition of a property type that has a fixed number of values of the underlying type. The order of the values is meaningful.
makeTypeDefinitionFixedArray()
,
TypeCategory.FixedArray
,
TypeDefinitionVariableArray
,
TypeDefinitionSet
Method Summary | |
---|---|
PropertyValue |
createValueFromArray(Object[] initialData)
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. |
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. |
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. |
Methods inherited from interface tv.amwa.maj.iface.TypeDefinition |
---|
createValue, getTypeCategory |
Methods inherited from interface tv.amwa.maj.iface.MetaDefinition |
---|
getAUID, getDescription, getName, setDescription, setName |
Method Detail |
---|
TypeDefinition getType()
Returns the underlying type of that defines the type of each element of the array defined by this fixed array type definition.
@UInt32 int getCount()
Returns the number of elements of an array defined by this fixed array type definition.
PropertyValue createValueFromValues(PropertyValue[] elementValues) throws NullPointerException, BadParameterException, BadTypeException
Creates and returns a fixed array property value from the given array of property values.
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 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 getType()
.PropertyValue createValueFromArray(Object[] initialData) throws NullPointerException, BadParameterException, BadTypeException
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 getType()
and using a
call to TypeDefinition.createValue(Object)
.
initialData
- 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 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 getType()
.TypeDefinition.createValue(Object)
,
getArray(PropertyValue)
,
setArray(PropertyValue, Object[])
PropertyValue getElementValue(PropertyValue arrayProperty, @UInt32 int index) throws NullPointerException, IndexOutOfBoundsException, IllegalPropertyValueException
Returns the member property value at the given index through the given fixed array property value.
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.Object[] getArray(PropertyValue arrayProperty) throws NullPointerException, IllegalPropertyValueException
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.
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.createValueFromArray(Object[])
,
getElements(PropertyValue)
void setElementValue(PropertyValue arrayProperty, @UInt32 int index, PropertyValue memberProperty) throws NullPointerException, IllegalPropertyValueException, IndexOutOfBoundsException, BadTypeException
Sets the value of a member of the given fixed array property value at the given index using the given value.
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 getType()
.getElements(PropertyValue)
void setArray(PropertyValue arrayProperty, Object[] data) throws NullPointerException, IllegalPropertyValueException, BadParameterException, BadTypeException
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 getType()
and using
TypeDefinition.createValue(Object)
.
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 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 getType()
.createValueFromArray(Object[])
,
TypeDefinition.createValue(Object)
List<PropertyValue> getElements(PropertyValue arrayProperty) throws NullPointerException, IllegalPropertyValueException
Returns a list over all the property values of the given fixed array property value.
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.getArray(PropertyValue)
,
getElementValue(PropertyValue, int)
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |