Media Authoring
with Java API

tv.amwa.maj.iface
Interface TypeDefinitionSet

All Superinterfaces:
MetaDefinition, TypeDefinition
All Known Implementing Classes:
TypeDefinitionSet

public interface TypeDefinitionSet
extends TypeDefinition

Specifies the definition of a property type that has a collection of object references to uniquely identified objects. The order of the objects has no meaning.

Note that the element type for a set must be a reference type. For example and as a result, it is not possible to define a set of integer values.

Author:
Richard Cartwright
See Also:
makeTypeDefinitionSet(), TypeCategory.Set, TypeDefinitionFixedArray, TypeDefinitionVariableArray

Method Summary
 void addElement(PropertyValue setPropertyValue, PropertyValue elementPropertyValue)
          Adds the given element to the given set, which is represented by the given property value of this set type definition.
 boolean containsElement(PropertyValue setPropertyValue, PropertyValue elementPropertyValue)
          Returns true if the given element is contained in the given set; otherwise false.
 PropertyValue createEmptySet()
          Create a property value with an empty set, ready to hold property values of this type definitions element type.
 int getCount(PropertyValue setPropertyValue)
          Returns the number of elements in the given set, or -1 if the set is null.
 Set<PropertyValue> getElements(PropertyValue setPropertyValue)
          Returns a copy of the set of all the elements in the given set property value.
 TypeDefinitionObjectReference getElementType()
          Returns the type of elements referenced from the defined set.
 void removeElement(PropertyValue setPropertyValue, PropertyValue elementPropertyValue)
          Removes the given element from the given set, which is represented by the given property value of this set type definition.
 
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

getElementType

TypeDefinitionObjectReference getElementType()

Returns the type of elements referenced from the defined set.

Returns:
Type of elements referenced from the defined set.
See Also:
TypeDefinitionObjectReference.getObjectType()

addElement

void addElement(PropertyValue setPropertyValue,
                PropertyValue elementPropertyValue)
                throws NullPointerException,
                       IllegalPropertyValueException,
                       BadTypeException

Adds the given element to the given set, which is represented by the given property value of this set type definition.

Parameters:
setPropertyValue - Set to add the given element to.
elementPropertyValue - Element to add to the given set.
Throws:
NullPointerException - One or both of the arguments is/are null.
IllegalPropertyValueException - The type of the given property value does not match this set type definition.
BadTypeException - The type of the given element property value does not match the element type of this set type definition.

removeElement

void removeElement(PropertyValue setPropertyValue,
                   PropertyValue elementPropertyValue)
                   throws NullPointerException,
                          IllegalPropertyValueException,
                          BadTypeException,
                          ObjectNotFoundException

Removes the given element from the given set, which is represented by the given property value of this set type definition.

Parameters:
setPropertyValue - Set to remove the given element from.
elementPropertyValue - Element to remove from the given set.
Throws:
NullPointerException - One or both of the arguments is/are null.
IllegalPropertyValueException - The type of the given property value does not match this set type definition.
BadTypeException - The type of the given element for removal does not match the element type of this set type definition.
ObjectNotFoundException - The given element to remove cannot be found in the given set property value.

containsElement

@Bool
boolean containsElement(PropertyValue setPropertyValue,
                             PropertyValue elementPropertyValue)
                        throws NullPointerException,
                               IllegalPropertyValueException

Returns true if the given element is contained in the given set; otherwise false. The set to test membership for is represented by the given property value of this set type definition.

Parameters:
setPropertyValue - Set to check for the given element.
elementPropertyValue - Element to check for in the given set.
Returns:
Is the given element contained in the given set?
Throws:
NullPointerException - One or both of the arguments is/are null.
IllegalPropertyValueException - The type of the given property value does not match this set type definition.

getCount

@UInt32
int getCount(PropertyValue setPropertyValue)
             throws NullPointerException,
                    IllegalPropertyValueException

Returns the number of elements in the given set, or -1 if the set is null. The set to count the members for is represented by the given property value of this set type definition.

Parameters:
setPropertyValue - Property value containing a set.
Returns:
Number of elements in the given set.
Throws:
NullPointerException - The given set property value is null.
IllegalPropertyValueException - The type of the given property value does not match this set type definition.

getElements

Set<PropertyValue> getElements(PropertyValue setPropertyValue)
                               throws NullPointerException,
                                      IllegalPropertyValueException

Returns a copy of the set of all the elements in the given set property value.

Parameters:
setPropertyValue - Property value to read and returns the elements for.
Returns:
Shallow copy of the value of the given set property value.
Throws:
NullPointerException - The given set property value is null.
IllegalPropertyValueException - The type of the given argument does not match this set type definition.

createEmptySet

PropertyValue createEmptySet()

Create a property value with an empty set, ready to hold property values of this type definitions element type. Call addElement(PropertyValue, PropertyValue) to add elements to this set.

Returns:
New property value containing an empty set.

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.