Media Authoring
with Java API

tv.amwa.maj.entity
Class EssenceGroup

java.lang.Object
  extended by tv.amwa.maj.entity.InterchangeObject
      extended by tv.amwa.maj.entity.Component
          extended by tv.amwa.maj.entity.Segment
              extended by tv.amwa.maj.entity.EssenceGroup
All Implemented Interfaces:
Serializable, Cloneable, MAJCommon, Component, EssenceGroup, InterchangeObject, Segment, XMLSerializable

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=1280,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="EssenceGroup",
          description="The EssenceGroup class describes multiple digital representations of the same original content source.")
public class EssenceGroup
extends Segment
implements EssenceGroup, Serializable, Cloneable, MAJCommon

Implements the description of multiple digital representations of the same original content source. The essence type and length of all choices must be the same.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class EssenceGroup.ChoicesXMLHandler
           
static class EssenceGroup.StillFrameXMLHandler
           
static class EssenceGroup.XMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.Segment
Segment.SegmentXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.Component
Component.ComponentAttributesXMLHandler, Component.ComponentUserCommentsXMLHandler, Component.ComponentXMLHandler, Component.KLVDataXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject
InterchangeObject.InterchangeObjectXMLHandler
 
Field Summary
 
Fields inherited from class tv.amwa.maj.entity.Component
COMPONENT_ITEM
 
Constructor Summary
EssenceGroup(DataDefinition dataDefinition, long length)
          Creates and initializes a new essence group segment, which describes multiple digital representations of the same original content source.
 
Method Summary
 void appendChoice(Segment choice)
          Append a choice to the collection of segment choices of this essence group, which identify the alternate representations that may be chosen.
 void appendXMLChildren(Node parent)
          Append child elements to the given parent node to serialize the value of an object to an XML fragment.
 EssenceGroup clone()
          Creates a cloned copy of this entity.
 int countChoices()
          Returns the number of choices in the collection of alternates of this essence group, which identify the alternate representations that may be chosen.
 boolean equals(Object o)
          Tests to see if the given object is equal to this interchange object.
 Segment getChoiceAt(int index)
          Returns the source clip choice at the given index in the collection of choices of this essence group, which identify the alternate representations that may be chosen.
 List<Segment> getChoices()
           
 SourceReferenceSegment getStillFrame()
          Gets the still frame property of this essence group, which identifies the essence for a single-frame image representation of the group.
 int hashCode()
          Returns a hash code value for this interchange object.
 void insertChoiceAt(int index, Segment choice)
          Insert another choice to the collections of choices of this essence group at the given index.
 void prependChoice(Segment choice)
          Prepend a choice to the collection of segment choices of this essence group, which identify the alternate representations that may be chosen.
 void removeChoiceAt(int index)
          Removes the choice at the given index in the collection of choices of this essence group, which identify the alternate representations that may be chosen.
 void setPropertiesFromInterface(EssenceGroup castFrom)
           
 void setStillFrame(SourceReferenceSegment stillFrame)
          Sets the still frame property of this essence group, which identifies the essence for a single-frame image representation of the group.
 
Methods inherited from class tv.amwa.maj.entity.Segment
segmentOffsetToTC, segmentTCToOffset, setPropertiesFromInterface
 
Methods inherited from class tv.amwa.maj.entity.Component
appendAttribute, appendAttribute, appendComment, appendComment, appendKLVData, countAttributes, countComments, countKLVData, getAttributes, getComments, getDataDefinition, getKLVData, getLength, getLengthPresent, removeAttribute, removeComment, removeKLVData, setDataDefinition, setLength, setLengthPresent, setPropertiesFromInterface
 
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, toString, wait, wait, wait
 
Methods inherited from interface tv.amwa.maj.iface.Segment
segmentOffsetToTC, segmentTCToOffset
 
Methods inherited from interface tv.amwa.maj.iface.Component
appendAttribute, appendAttribute, appendComment, appendComment, appendKLVData, countAttributes, countComments, countKLVData, getAttributes, getComments, getDataDefinition, getKLVData, getLength, removeAttribute, removeComment, removeKLVData, setDataDefinition, setLength
 
Methods inherited from interface tv.amwa.maj.iface.InterchangeObject
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue
 
Methods inherited from interface tv.amwa.maj.entity.MAJCommon
toString
 

Constructor Detail

EssenceGroup

public EssenceGroup(DataDefinition dataDefinition,
                    long length)
             throws NullPointerException,
                    BadLengthException

Creates and initializes a new essence group segment, which describes multiple digital representations of the same original content source.

Parameters:
dataDefinition - Kind of data described by the component.
length - Length of each and every segment in this group.
Throws:
NullPointerException - Data definition argument is null.
BadLengthException - Cannot set the length of a component to a negative value.
Method Detail

setPropertiesFromInterface

public final void setPropertiesFromInterface(EssenceGroup castFrom)
See Also:
InterchangeObject.setPropertiesFromInterface(tv.amwa.maj.iface.InterchangeObject)

appendChoice

public void appendChoice(Segment choice)
                  throws NullPointerException,
                         InvalidDataDefinitionException,
                         BadLengthException
Description copied from interface: EssenceGroup

Append a choice to the collection of segment choices of this essence group, which identify the alternate representations that may be chosen. The order of the items in the collection is not meaningful.

Specified by:
appendChoice in interface EssenceGroup
Parameters:
choice - Source clip to add in as a choice to the collection of choices of this essence group.
Throws:
NullPointerException - The given segment choice is null.
InvalidDataDefinitionException - The data definition of the given segment does not convert to an acceptable definition for this group.
BadLengthException - The length of the given segment is different to the length of other choices of this group.

countChoices

public int countChoices()
Description copied from interface: EssenceGroup

Returns the number of choices in the collection of alternates of this essence group, which identify the alternate representations that may be chosen. The count does not include the still frame.

Specified by:
countChoices in interface EssenceGroup
Returns:
Number of choices in this essence group

getChoiceAt

public Segment getChoiceAt(int index)
                    throws IndexOutOfBoundsException
Description copied from interface: EssenceGroup

Returns the source clip choice at the given index in the collection of choices of this essence group, which identify the alternate representations that may be chosen.

Specified by:
getChoiceAt in interface EssenceGroup
Parameters:
index - The 0-based index into the collection of choices of this essence group.
Returns:
The corresponding choice at the given index.
Throws:
IndexOutOfBoundsException - Index is outside the acceptable range for the collection of this essence group.

insertChoiceAt

public void insertChoiceAt(int index,
                           Segment choice)
                    throws NullPointerException,
                           IndexOutOfBoundsException,
                           InvalidDataDefinitionException,
                           BadLengthException
Description copied from interface: EssenceGroup

Insert another choice to the collections of choices of this essence group at the given index. The choices identify the alternate representations that may be chosen. Choices already existing at the given and higher indices will be moved up by one index to accommodate.

Specified by:
insertChoiceAt in interface EssenceGroup
Parameters:
index - Index at which to insert a new choice into the collection of choices of this essence group.
choice - Segment to add as a choice.
Throws:
NullPointerException - The given choice segment is null.
IndexOutOfBoundsException - Index is outside the acceptable range for this group.
InvalidDataDefinitionException - The data definition of the given segment does not convert to an acceptable definition for this group.
BadLengthException - The length of the given segment is different to the length for other choices of the group.

prependChoice

public void prependChoice(Segment choice)
                   throws NullPointerException,
                          InvalidDataDefinitionException,
                          BadLengthException
Description copied from interface: EssenceGroup

Prepend a choice to the collection of segment choices of this essence group, which identify the alternate representations that may be chosen. The order of the items in the collection is not meaningful.

Specified by:
prependChoice in interface EssenceGroup
Parameters:
choice - Source clip to add as a choice to the collection of choices of this essence group.
Throws:
NullPointerException - The given choice segment is null.
InvalidDataDefinitionException - The data definition of the given segment does not convert to an acceptable definition for this group.
BadLengthException - The length of the given segment is different to the length of other choices of the group.

removeChoiceAt

public void removeChoiceAt(int index)
                    throws IndexOutOfBoundsException
Description copied from interface: EssenceGroup

Removes the choice at the given index in the collection of choices of this essence group, which identify the alternate representations that may be chosen. Items already existing at higher indices will be moved down by one index to accommodate. The essence group should always contain at least one choice, although the implementation may not check this.

Specified by:
removeChoiceAt in interface EssenceGroup
Parameters:
index - The 0-based index into the collection of choices indicating which choice to remove.
Throws:
IndexOutOfBoundsException - Index is outside the acceptable range for this group.

getChoices

@AAFProperty(uuid1=100729092,
             uuid2=1537,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="Choices",
             typeName="StrongReferenceVector of Segment",
             optional=false,
             uniqueIdentifier=false,
             pid=1281)
public List<Segment> getChoices()

getStillFrame

@AAFProperty(uuid1=100729092,
             uuid2=520,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="StillFrame",
             typeName="StrongReference to SourceReference",
             optional=true,
             uniqueIdentifier=false,
             pid=1282)
public SourceReferenceSegment getStillFrame()
                                     throws PropertyNotPresentException
Description copied from interface: EssenceGroup

Gets the still frame property of this essence group, which identifies the essence for a single-frame image representation of the group. This is an optional property.

Specified by:
getStillFrame in interface EssenceGroup
Returns:
Still frame representation of this essence group.
Throws:
PropertyNotPresentException - The still frame property is not present within this essence group.

setStillFrame

public void setStillFrame(SourceReferenceSegment stillFrame)
                   throws NullPointerException,
                          InvalidDataDefinitionException,
                          BadLengthException
Description copied from interface: EssenceGroup

Sets the still frame property of this essence group, which identifies the essence for a single-frame image representation of the group. Call this method with null to omit this optional property.

Specified by:
setStillFrame in interface EssenceGroup
Parameters:
stillFrame - Still frame representation for the essence group.
Throws:
InvalidDataDefinitionException - The given source clip does not have a compatible data definition that can convert to the data definition of this essence group.
BadLengthException - The given source reference segment does not represent a still frame with a length of exactly 1.
NullPointerException

equals

public boolean equals(Object o)
Description copied from interface: MAJCommon

Tests to see if the given object is equal to this interchange object. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.

Specified by:
equals in interface MAJCommon
Overrides:
equals in class Component
Parameters:
o - Object to test for equality with.
Returns:
Is the given object equals to this value?
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Description copied from interface: MAJCommon

Returns a hash code value for this interchange object.

Specified by:
hashCode in interface MAJCommon
Overrides:
hashCode in class Component
Returns:
Hash code value for this interchange object.
See Also:
Object.hashCode()

clone

public EssenceGroup clone()
Description copied from interface: MAJCommon

Creates a cloned copy of this entity. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.

This method does not throw a CloneNotSupportedException as all entity values must implement the Cloneable interface. If a cloning error does occur, a null value will be returned but this is very unlikely to happen.

Specified by:
clone in interface MAJCommon
Overrides:
clone in class Segment
Returns:
Independent clone of this value, which is a deep copy.
See Also:
Object.clone()

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 Component
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.