Media Authoring
with Java API

tv.amwa.maj.entity
Class Component

java.lang.Object
  extended by tv.amwa.maj.entity.InterchangeObject
      extended by tv.amwa.maj.entity.Component
All Implemented Interfaces:
Serializable, Cloneable, Component, InterchangeObject, XMLSerializable
Direct Known Subclasses:
Segment, Transition

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=512,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="Component",
          description="The Component class represents an essence element.")
public abstract class Component
extends InterchangeObject
implements Component, Cloneable, Serializable

Implements an essence element.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class Component.ComponentAttributesXMLHandler
           
static class Component.ComponentUserCommentsXMLHandler
           
static class Component.ComponentXMLHandler
           
static class Component.KLVDataXMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject
InterchangeObject.InterchangeObjectXMLHandler
 
Field Summary
static String COMPONENT_ITEM
           
 
Constructor Summary
Component()
           
 
Method Summary
 void appendAttribute(String name, String value)
          Append an attribute name/value pair to the attributes collection of of this component, which specify attributes that are under the control of the application (for example filter control).
 void appendAttribute(TaggedValue taggedValue)
          Append an attribute defined by an existing tagged value to the attributes collection of this component, which specify attributes that are under the control of the application (for example filter control).
 void appendComment(String name, String value)
          Append a user comment name/value pair to the collection of user comments of the component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
 void appendComment(TaggedValue comment)
          Append a user comment defined by an existing tagged value to the collection of user comments of this component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
 void appendKLVData(KLVData data)
          Appends a KLV Data to the collection of KLV data of this component.
 void appendXMLChildren(Node parent)
          Append child elements to the given parent node to serialize the value of an object to an XML fragment.
 int countAttributes()
          Returns the size of the collection of attributes for the component, which specify attributes that are under the control of the application (for example filter control).
 int countComments()
          Returns the number of user comments in the collection of user comments of this component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
 int countKLVData()
          Returns the total number of KLV data in the collection for this component.
 boolean equals(Object o)
           
 List<TaggedValue> getAttributes()
          Returns the collection of attributes of this component, which specify attributes that are under the control of the application (for example filter control).
 List<TaggedValue> getComments()
          Returns the collection of user comments of the component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
 DataDefinition getDataDefinition()
          Returns the data definition of the component, which specifies the kind of data described by this component.
 List<KLVData> getKLVData()
          Returns the list of KLV data of this component.
 long getLength()
          Returns the length of this component, which specifies its duration in edit units.
 boolean getLengthPresent()
          Determines whether the length property is present for this component.
 int hashCode()
           
 void removeAttribute(TaggedValue attribute)
          Remove an attribute from the collection of attributes of this component, which specify attributes that are under the control of the application (for example filter control).
 void removeComment(TaggedValue comment)
          Removes a given user comment from the collection of user comments of this component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).
 void removeKLVData(KLVData data)
          Removes the given KLV data from the collection of this component.
 void setDataDefinition(DataDefinition dataDefinition)
          Sets the data definition property for the component, which specifies the kind of data described by this component.
 void setLength(long length)
          Sets the length property of this component, which specifies its duration in edit units.
 void setLengthPresent(boolean lengthPresent)
          Sets whether the length property is present for this component.
 void setPropertiesFromInterface(Component castFrom)
           
 
Methods inherited from class tv.amwa.maj.entity.InterchangeObject
castFromInterface, countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, registerImplementation, setPropertiesFromInterface, setPropertyValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface tv.amwa.maj.iface.InterchangeObject
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue
 

Field Detail

COMPONENT_ITEM

public static final String COMPONENT_ITEM
See Also:
Constant Field Values
Constructor Detail

Component

public Component()
Method Detail

setPropertiesFromInterface

public final void setPropertiesFromInterface(Component castFrom)

getAttributes

@AAFProperty(uuid1=50397712,
             uuid2=2048,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,7},
             definedName="Attributes",
             typeName="StrongReferenceVector of TaggedValue",
             optional=true,
             uniqueIdentifier=false,
             pid=517)
public List<TaggedValue> getAttributes()
Description copied from interface: Component

Returns the collection of attributes of this component, which specify attributes that are under the control of the application (for example filter control).

Specified by:
getAttributes in interface Component
Returns:
Shallow copy of the collection of attributes of this component.

appendAttribute

public void appendAttribute(String name,
                            String value)
                     throws NullPointerException
Description copied from interface: Component

Append an attribute name/value pair to the attributes collection of of this component, which specify attributes that are under the control of the application (for example filter control).

This method creates a new tagged value, initializes it with the specified attribute name/value pair, and appends it to the attribute list.

Specified by:
appendAttribute in interface Component
Parameters:
name - Name for the new attribute.
value - Corresponding value for the new attribute.
Throws:
NullPointerException - One or both of the given name and/or value method parameters are null.

appendAttribute

public void appendAttribute(TaggedValue taggedValue)
                     throws NullPointerException
Description copied from interface: Component

Append an attribute defined by an existing tagged value to the attributes collection of this component, which specify attributes that are under the control of the application (for example filter control).

Specified by:
appendAttribute in interface Component
Parameters:
taggedValue - Tagged value to be appended to the collection of attributes for this component.
Throws:
NullPointerException - The given attribute value is null.
See Also:
makeTaggedValue(), TaggedValueDefinition

removeAttribute

public void removeAttribute(TaggedValue attribute)
                     throws NullPointerException,
                            ObjectNotFoundException
Description copied from interface: Component

Remove an attribute from the collection of attributes of this component, which specify attributes that are under the control of the application (for example filter control).

Specified by:
removeAttribute in interface Component
Parameters:
attribute - Attribute to remove from the collection of attributes of the component.
Throws:
NullPointerException - The given attribute is null.
ObjectNotFoundException - The given tagged value is not currently contained by the list of attributes of this component.

countAttributes

public int countAttributes()
Description copied from interface: Component

Returns the size of the collection of attributes for the component, which specify attributes that are under the control of the application (for example filter control).

Specified by:
countAttributes in interface Component
Returns:
Size of the collection of attributes of this component.

getComments

@AAFProperty(uuid1=50462978,
             uuid2=5632,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,7},
             definedName="UserComments",
             typeName="StrongReferenceVector of TaggedValue",
             optional=true,
             uniqueIdentifier=false,
             pid=516)
public List<TaggedValue> getComments()
Description copied from interface: Component

Returns the collection of user comments of the component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

Specified by:
getComments in interface Component
Returns:
Shallow copy of the collection of user comments for this component.

appendComment

public void appendComment(String name,
                          String value)
                   throws NullPointerException
Description copied from interface: Component

Append a user comment name/value pair to the collection of user comments of the component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

This method creates a new tagged value, initializes it with the specified comment name/value pair, and appends it to the comment list.

Specified by:
appendComment in interface Component
Parameters:
name - The name associated with the new comment to create.
value - The corresponding value, or description, of the new comment.
Throws:
NullPointerException - One or both of the name and/or value values is/are null.
See Also:
makeTaggedValue()

appendComment

public void appendComment(TaggedValue comment)
Description copied from interface: Component

Append a user comment defined by an existing tagged value to the collection of user comments of this component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

Specified by:
appendComment in interface Component
Parameters:
comment - User comment to append to the collection of user comments of this component.
See Also:
makeTaggedValue(), TaggedValueDefinition

countComments

public int countComments()
Description copied from interface: Component

Returns the number of user comments in the collection of user comments of this component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

Specified by:
countComments in interface Component
Returns:
Number of user comments of the component.

removeComment

public void removeComment(TaggedValue comment)
                   throws NullPointerException,
                          ObjectNotFoundException
Description copied from interface: Component

Removes a given user comment from the collection of user comments of this component, which specify user comments that are directly classified and set up by the operator (for example Bin columns).

Specified by:
removeComment in interface Component
Parameters:
comment - User comment to remove from the collection of user comments of this component.
Throws:
NullPointerException - The given comment is null.
ObjectNotFoundException - The comment to be removed cannot be found in the collection of comments of this component.

getDataDefinition

@AAFProperty(uuid1=67567872,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="DataDefinition",
             typeName="WeakReference to DataDefinition",
             optional=false,
             uniqueIdentifier=false,
             pid=513)
public DataDefinition getDataDefinition()
Description copied from interface: Component

Returns the data definition of the component, which specifies the kind of data described by this component.

Specified by:
getDataDefinition in interface Component
Returns:
Data definition of this component.

setDataDefinition

public void setDataDefinition(DataDefinition dataDefinition)
                       throws NullPointerException
Description copied from interface: Component

Sets the data definition property for the component, which specifies the kind of data described by this component.

Specified by:
setDataDefinition in interface Component
Parameters:
dataDefinition - Data definition of this component.
Throws:
NullPointerException - The given data definition is null.

getKLVData

@AAFProperty(uuid1=50397712,
             uuid2=1024,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="KLVData",
             typeName="StrongReferenceVector of KLVData",
             optional=true,
             uniqueIdentifier=false,
             pid=515)
public List<KLVData> getKLVData()
Description copied from interface: Component

Returns the list of KLV data of this component.

Specified by:
getKLVData in interface Component
Returns:
Shallow copy of the list of KLV data of this component.

appendKLVData

public void appendKLVData(KLVData data)
                   throws NullPointerException
Description copied from interface: Component

Appends a KLV Data to the collection of KLV data of this component.

Specified by:
appendKLVData in interface Component
Parameters:
data - KLV data value to add to the set of KLV data values of this component.
Throws:
NullPointerException - The given KLV data value is null.
See Also:
makeKLVData()

countKLVData

public int countKLVData()
Description copied from interface: Component

Returns the total number of KLV data in the collection for this component.

Specified by:
countKLVData in interface Component
Returns:
Number of KLV data objects in this collection for this component.

removeKLVData

public void removeKLVData(KLVData data)
                   throws NullPointerException,
                          ObjectNotFoundException
Description copied from interface: Component

Removes the given KLV data from the collection of this component.

Specified by:
removeKLVData in interface Component
Parameters:
data - KLV data value to remove from the component.
Throws:
NullPointerException - The given KLV data item is null.
ObjectNotFoundException - The given KLV data object is not in the collection of this component.

getLength

@AAFProperty(uuid1=117572097,
             uuid2=259,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="Length",
             typeName="LengthType",
             optional=true,
             uniqueIdentifier=false,
             pid=514)
public long getLength()
               throws BadPropertyException
Description copied from interface: Component

Returns the length of this component, which specifies its duration in edit units. This is an optional property, which will be present for time-varying media and may be present for events.

Specified by:
getLength in interface Component
Returns:
Length of this component in edit units.
Throws:
BadPropertyException - The optional length property is not present for this object.

setLength

public void setLength(long length)
               throws BadLengthException
Description copied from interface: Component

Sets the length property of this component, which specifies its duration in edit units. This is an optional property, which will only be present for time-varying media.

Specified by:
setLength in interface Component
Parameters:
length - The duration in edit units of this component.
Throws:
BadLengthException - Cannot set the length to a negative value.

getLengthPresent

public boolean getLengthPresent()

Determines whether the length property is present for this component. This method allows a user to prepare a component for a specific kind of mob slot according the the length rules of mob slots. These rules are:

The default value is that length values are not present, although components that are not appropriate for static data overried this to be true.

Returns:
Is the context-dependent length property present for this component?

setLengthPresent

public void setLengthPresent(boolean lengthPresent)

Sets whether the length property is present for this component. This method allows a user to prepare a component for a specific kind of mob slot according the the length rules of mob slots. These rules are:

The default value is that length values are not present, although components that are not appropriate for static data override this to be true. The constructors and setSegment() methods of timeline mob slot and static mob slot will set the presence or absence of the length property according to the above rules. Therefore, this method is mainly useful to set whether an event should be considered as instantaneous or not.

Parameters:
lengthPresent - Is the context-dependent length property present for this component?

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

appendXMLChildren

public void appendXMLChildren(Node parent)
Description copied from interface: 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.

Specified by:
appendXMLChildren in interface XMLSerializable
Overrides:
appendXMLChildren in class InterchangeObject
Parameters:
parent - XML parent element to append child nodes to.

Media Authoring
with Java API

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