Media Authoring
with Java API

tv.amwa.maj.entity
Class OperationGroup

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.OperationGroup
All Implemented Interfaces:
Serializable, Cloneable, MAJCommon, Component, InterchangeObject, OperationGroup, Segment, XMLSerializable

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=2560,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="OperationGroup",
          description="The OperationGroup class contains an ordered set of Segments and an operation that is performed on these Segments.")
public class OperationGroup
extends Segment
implements OperationGroup, Serializable, Cloneable, MAJCommon

Implements a container with an ordered set of segments and an operation that is performed on these segments.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class OperationGroup.InputSegmentsXMLHandler
           
static class OperationGroup.ParametersXMLHandler
           
static class OperationGroup.RenderingXMLHandler
           
static class OperationGroup.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
OperationGroup(DataDefinition dataDefinition, long length, OperationDefinition operation)
          Creates and initializes a new operation group class, which contains an ordered set of segments and an operation that is performed on these.
 
Method Summary
 void addParameter(Parameter parameter)
          Adds a new parameter to the collection of parameters of this operation group, which specify control values for the operation.
 void appendInputSegment(Segment segment)
          Appends an input segment to the list of input segments of this operation group.
 void appendXMLChildren(Node parent)
          Append child elements to the given parent node to serialize the value of an object to an XML fragment.
 OperationGroup clone()
          Creates a cloned copy of this entity.
 int countParameters()
          Returns the number of parameters in the collection of parameters of this operation group, which specify control values for the operation.
 int countSourceSegments()
          Returns the number of media sources for this operation group, which is the size of the list of input segments for this operation.
 boolean equals(Object o)
          Tests to see if the given object is equal to this interchange object.
 int getBypassOverride()
          Returns the optional bypass override index of this operation group, which specifies the array index (1-based) of the input segment which is the primary input.
 Segment getInputSegmentAt(int index)
          Given an index, returns the corresponding input segment from this list of input segments of this operation group.
 List<Segment> getInputSegments()
           
 OperationDefinition getOperationDefinition()
          Returns the operation definition for this operation group, which identifies the kind of operation.
 List<Parameter> getParameters()
          Returns the list of parameters of this operation group, which specify control values for the operation.
 SourceReferenceSegment getRendering()
          Returns the segment that represents the optional rendering of this operation group, which specifies a rendered or precomputed version of the operation.
 int hashCode()
          Returns a hash code value for this interchange object.
 void insertInputSegmentAt(int index, Segment segment)
          Inserts an input segment into the list of input segments of this operation group at the given index.
 boolean isTimeWarp()
          Returns true if an operation group represents a time warping effect.
 boolean isValidTransitionOperation()
          Returns true if this operation group can be used in a transition; otherwise returns false.
 Parameter lookupParameter(AUID argID)
          Given an argument id, returns the corresponding parameter slot from the collection of parameters of this operation group.
 void prependInputSegment(Segment segment)
          Prepends an input segment to the list of input segments of this operation group.
 void removeInputSegmentAt(int index)
          Removes the segment at the given index from the list of input segments of the operation group.
 void setBypassOverride(Integer bypassOverride)
          Sets the optional bypass override property on the given operation group object, which specifies the array index (1-based) of the input segment which is the primary input.
 void setOperationDefinition(OperationDefinition operationDefinition)
          Sets the operation definition for the operation group, which identifies the kind of operation.
 void setPropertiesFromInterface(OperationGroup castFrom)
           
 void setRendering(SourceReferenceSegment sourceReference)
          Returns the segment that represents the optional rendering of this operation group, which specifies a rendered or precomputed version of the operation.
 
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, 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

OperationGroup

public OperationGroup(DataDefinition dataDefinition,
                      long length,
                      OperationDefinition operation)
               throws NullPointerException,
                      BadLengthException

Creates and initializes a new operation group class, which contains an ordered set of segments and an operation that is performed on these. The lists of segments and parameters are initialized to empty lists.

Parameters:
dataDefinition - Data definition object that specifies the kind of data described by the component.
length - Length of the component represented by this operation group.
operation - Operation definition that identifies the kind of operation.
Throws:
NullPointerException - One or more of the arguments are null.
BadLengthException - Cannot set the length of an operation group to a negative value.
Method Detail

setPropertiesFromInterface

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

getParameters

@AAFProperty(uuid1=100729092,
             uuid2=1546,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="Parameters",
             typeName="StrongReferenceVector of Parameter",
             optional=true,
             uniqueIdentifier=false,
             pid=2819)
public List<Parameter> getParameters()
Description copied from interface: OperationGroup

Returns the list of parameters of this operation group, which specify control values for the operation. This is an optional property that returns an empty list when not present.

Specified by:
getParameters in interface OperationGroup
Returns:
Shallow copy of the collection of parameters of this operation group.

addParameter

public void addParameter(Parameter parameter)
                  throws DuplicateParameterException,
                         NullPointerException
Description copied from interface: OperationGroup

Adds a new parameter to the collection of parameters of this operation group, which specify control values for the operation. This is an optional property that becomes present when this method is called.

Specified by:
addParameter in interface OperationGroup
Parameters:
parameter - Parameter to add to the collection of parameters of this operation group.
Throws:
DuplicateParameterException - The given parameter has the same identifier as one that is already present in this operation group.
NullPointerException - The given parameter is null.

countParameters

public int countParameters()
Description copied from interface: OperationGroup

Returns the number of parameters in the collection of parameters of this operation group, which specify control values for the operation. This is an optional property and this method returns 0 when the property is not present.

Specified by:
countParameters in interface OperationGroup
Returns:
Number of parameters in the collection of parameters of this operation group.

lookupParameter

public Parameter lookupParameter(AUID argID)
                          throws ParameterNotFoundException,
                                 NullPointerException
Description copied from interface: OperationGroup

Given an argument id, returns the corresponding parameter slot from the collection of parameters of this operation group.

Specified by:
lookupParameter in interface OperationGroup
Parameters:
argID - Argument id to look up in the collection of parameters of this operation group.
Returns:
Matching parameter from the operation group.
Throws:
ParameterNotFoundException - The given argument identifier does not match that of a parameter in the set of parameters for this operation group.
NullPointerException - The given argument identifier is null.

getInputSegments

@AAFProperty(uuid1=100729092,
             uuid2=1538,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="InputSegments",
             typeName="StrongReferenceVector of Segment",
             optional=true,
             uniqueIdentifier=false,
             pid=2818)
public List<Segment> getInputSegments()

getInputSegmentAt

public Segment getInputSegmentAt(int index)
                          throws IndexOutOfBoundsException
Description copied from interface: OperationGroup

Given an index, returns the corresponding input segment from this list of input segments of this operation group. This is an optional property and this method will always throw an IndexOutOfBoundsException if the property is omitted.

Specified by:
getInputSegmentAt in interface OperationGroup
Parameters:
index - 0-based index into the list of input segments of this operation group.
Returns:
Input segment at the given index.
Throws:
IndexOutOfBoundsException - The index is outside the acceptable range for the list of input segments.

appendInputSegment

public void appendInputSegment(Segment segment)
                        throws NullPointerException
Description copied from interface: OperationGroup

Appends an input segment to the list of input segments of this operation group. The list is an optional property that will become present if a segment is appended.

Specified by:
appendInputSegment in interface OperationGroup
Parameters:
segment - Segment to append to the list of input segments of this operation group.
Throws:
NullPointerException - The given segment to append is null.

countSourceSegments

public int countSourceSegments()
Description copied from interface: OperationGroup

Returns the number of media sources for this operation group, which is the size of the list of input segments for this operation. The input segments list is an optional property and 0 will be returned if the property is omitted.

Specified by:
countSourceSegments in interface OperationGroup
Returns:
Number of media sources for this operation group.

insertInputSegmentAt

public void insertInputSegmentAt(int index,
                                 Segment segment)
                          throws NullPointerException,
                                 IndexOutOfBoundsException
Description copied from interface: OperationGroup

Inserts an input segment into the list of input segments of this operation group at the given index. The existing segments at the given and higher indices are moved up by one to make room. This is an optional property that will become present if a segment is inserted at index 0.

Specified by:
insertInputSegmentAt in interface OperationGroup
Parameters:
index - 0-based index where input segment is to be inserted.
segment - Input segment to insert at the given index.
Throws:
NullPointerException - The given segment to insert is null.
IndexOutOfBoundsException - The index value is outside the acceptable range for the list of input segments.

prependInputSegment

public void prependInputSegment(Segment segment)
                         throws NullPointerException
Description copied from interface: OperationGroup

Prepends an input segment to the list of input segments of this operation group. The list is an optional property that will become present if a segment is prepended.

Specified by:
prependInputSegment in interface OperationGroup
Parameters:
segment - Input segment to add to the beginning of the list of input segments.
Throws:
NullPointerException - The given segment to prepend is null.

removeInputSegmentAt

public void removeInputSegmentAt(int index)
                          throws IndexOutOfBoundsException
Description copied from interface: OperationGroup

Removes the segment at the given index from the list of input segments of the operation group. Existing segments at higher indices are moved down by one to accommodate. This is an optional property and this method will always throw an IndexOutOfBoundsException if the property is omitted. Removing the last input segment from the list will omit this property.

Specified by:
removeInputSegmentAt in interface OperationGroup
Parameters:
index - 0-based index into the list of input segments of this operation group.
Throws:
IndexOutOfBoundsException - The index is outside the acceptable range for the list of input segments.

getBypassOverride

@AAFProperty(uuid1=87033100,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="BypassOverride",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=2820)
public int getBypassOverride()
                      throws PropertyNotPresentException
Description copied from interface: OperationGroup

Returns the optional bypass override index of this operation group, which specifies the array index (1-based) of the input segment which is the primary input. This overrides any bypass specified by the operation definition. This is an optional property.

Specified by:
getBypassOverride in interface OperationGroup
Returns:
Optional bypass override index of the operation group.
Throws:
PropertyNotPresentException - The optional bypass override property is not set for the operation group.
See Also:
OperationDefinition.getBypass(), OperationGroup.getOperationDefinition()

setBypassOverride

public void setBypassOverride(Integer bypassOverride)
                       throws IllegalArgumentException
Description copied from interface: OperationGroup

Sets the optional bypass override property on the given operation group object, which specifies the array index (1-based) of the input segment which is the primary input. This overrides any bypass specified by the operation definition. Set this optional property to null to omit it.

Specified by:
setBypassOverride in interface OperationGroup
Parameters:
bypassOverride - Bypass override property of this operation group.
Throws:
IllegalArgumentException - The bypass override property must be a 1-based index value.

getOperationDefinition

@AAFProperty(uuid1=87033094,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="Operation",
             typeName="WeakReference to OperationDefinition",
             optional=false,
             uniqueIdentifier=false,
             pid=2817)
public OperationDefinition getOperationDefinition()
Description copied from interface: OperationGroup

Returns the operation definition for this operation group, which identifies the kind of operation.

Specified by:
getOperationDefinition in interface OperationGroup
Returns:
Operation definition for this operation group.

setOperationDefinition

public void setOperationDefinition(OperationDefinition operationDefinition)
                            throws NullPointerException
Description copied from interface: OperationGroup

Sets the operation definition for the operation group, which identifies the kind of operation.

Specified by:
setOperationDefinition in interface OperationGroup
Parameters:
operationDefinition - Operation definition for the operation group.
Throws:
NullPointerException - The given operation definition is null.

getRendering

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

Returns the segment that represents the optional rendering of this operation group, which specifies a rendered or precomputed version of the operation. Working and final renderings are handled by using an essence group as the segment.

Specified by:
getRendering in interface OperationGroup
Returns:
Segment that represents the optional rendering of this operation group.
Throws:
PropertyNotPresentException - The optional rendering property is not present for this operation group.
See Also:
SourceClip

setRendering

public void setRendering(SourceReferenceSegment sourceReference)
Description copied from interface: OperationGroup

Returns the segment that represents the optional rendering of this operation group, which specifies a rendered or precomputed version of the operation. Multiple renderings may exist if the source clip refers to a master mob that contains an essence group.

Specified by:
setRendering in interface OperationGroup
Parameters:
sourceReference - Segment containing a representation of the rendering.
See Also:
SourceClip

isTimeWarp

public boolean isTimeWarp()
Description copied from interface: OperationGroup

Returns true if an operation group represents a time warping effect.

Specified by:
isTimeWarp in interface OperationGroup
Returns:
Does this operation group have an operation that warps time?
See Also:
OperationGroup.getOperationDefinition(), OperationDefinition.isTimeWarp()

isValidTransitionOperation

public boolean isValidTransitionOperation()
Description copied from interface: OperationGroup

Returns true if this operation group can be used in a transition; otherwise returns false. An operation group can be used in a transition if its operation has exactly 2 inputs and the operation has a level parameter.

Specified by:
isValidTransitionOperation in interface OperationGroup
Returns:
Can the operation group be used in a transition?
See Also:
Transition.setOperationGroup(OperationGroup)

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