SequenceImpl (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.model.impl

## Class SequenceImpl

- java.lang.Object
- - tv.amwa.maj.model.impl.InterchangeObjectImpl
  - - tv.amwa.maj.model.impl.ComponentImpl
    - - tv.amwa.maj.model.impl.SegmentImpl
      - - tv.amwa.maj.model.impl.SequenceImpl

- All Implemented Interfaces:
    Serializable, Cloneable, QComponent, QSegment, QSequence, MediaEntity, MetadataObject, Component, InterchangeObject, Segment, Sequence

      @MediaClass(uuid1=218169601,
                  uuid2=257,
                  uuid3=3840,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="Sequence",
                  description="The Sequence class combines an ordered list of Segments and Transitions.",
                  symbol="Sequence")
      public class SequenceImpl
      extends SegmentImpl
      implements Sequence, QSequence, Serializable, Cloneable

  Implements the representation of the combination of an ordered list of segments and transitions. A sequence is the mechanism for combining sections of essence to be played in a sequential manner. If a sequence object has one segment followed by another segment, after the first segment is played, the following one begins immediately.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SequenceImpl()`
    `SequenceImpl(DataDefinition dataDefinition)` Creates and initializes a new sequence, which combines an ordered list of `segments` and `transitions`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendComponentObject(Component componentObject)` Appends the given component to this sequence.
    `void` | `clearComponentObjects()` Clear all component objects from the sequence.
    `Sequence` | `clone()` Create a cloned copy of this interchange object.
    `int` | `countComponentObjects()` Returns the number of components in this sequence.
    `Component` | `getComponentObjectAt(int index)` Returns the component at the given index through this sequence.
    `List<Component>` | `getComponentObjects()` Returns a list of all the components of this sequence.
    `String` | `getCompositeRushID()`
    `int` | `getCompositeRushIndicator()`
    `long` | `getCompositeRushOffset()`
    `static List<Component>` | `initializeComponentObjects()`
    `void` | `insertComponentObjectAt(int index, Component component)` Insert the given component into this sequence at the given index.
    `void` | `prependComponentObject(Component component)` Prepends the given component to this sequence.
    `void` | `removeComponentObjectAt(int index)` Removes the component at the given index from this sequence.
    `void` | `setCompositeRushID(String compositeRushID)`
    `void` | `setCompositeRushIndicator(Integer compositeRushIndicator)`
    `void` | `setCompositeRushOffset(Long compositeRushOffset)`

    - ### Methods inherited from class tv.amwa.maj.model.impl.SegmentImpl

      `generateSequence, getCutPoint, getKeyOffset, getPackLayerKeyIndicator, getSegmentBlob, getTrackBlob, getTrackKeyRenderSequence, getTrackName, getTrackRenderSequence, segmentOffsetToTC, segmentTCToOffset, setCutPoint, setKeyOffset, setPackLayerKeyIndicator, setSegmentBlob, setTrackBlob, setTrackKeyRenderSequence, setTrackName, setTrackRenderSequence`

    - ### Methods inherited from class tv.amwa.maj.model.impl.ComponentImpl

      `appendComponentAttribute, appendComponentAttribute, appendComponentKLVData, appendComponentUserComment, appendComponentUserComment, clearComponentAttributes, clearComponentKLVData, clearComponentUserComments, countComponentAttributes, countComponentKLVData, countComponentUserComments, getComment, getComponentAttributes, getComponentDataDefinition, getComponentKLVData, getComponentLength, getComponentUserComments, getEditName, getJupiterClipOffset, getJupiterID, getLengthPresent, initializeComponentDataDefinition, prependComponentAttribute, prependComponentKLVData, prependComponentUserComment, removeComponentAttribute, removeComponentKLVData, removeComponentUserComment, setComponentDataDefinition, setComponentLength, setComponentLengthFromStream, setEditName, setJupiterClipOffset, setJupiterID, setLengthPresent`

    - ### Methods inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `addApplicationPlugin, appendXMLChildren, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getLinkedGenerationIDString, getObjectClass, getPersistentID, getPersistentIndex, hashCode, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setLinkedGenerationIDString, setObjectClass, setPersistentID, setPersistentIndex, toString`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface tv.amwa.maj.model.Segment

      `generateSequence, segmentOffsetToTC, segmentTCToOffset`

    - ### Methods inherited from interface tv.amwa.maj.model.Component

      `appendComponentAttribute, appendComponentAttribute, appendComponentKLVData, appendComponentUserComment, appendComponentUserComment, clearComponentAttributes, clearComponentKLVData, clearComponentUserComments, countComponentAttributes, countComponentKLVData, countComponentUserComments, getComponentAttributes, getComponentDataDefinition, getComponentKLVData, getComponentLength, getComponentUserComments, getLengthPresent, removeComponentAttribute, removeComponentKLVData, removeComponentUserComment, setComponentDataDefinition, setComponentLength, setLengthPresent`

    - ### Methods inherited from interface tv.amwa.maj.model.InterchangeObject

      `addApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toString`

    - ### Methods inherited from interface tv.amwa.maj.industry.MediaEntity

      `getPersistentID, setPersistentIndex`

- - ### Constructor Detail

    - #### SequenceImpl

          public SequenceImpl()

    - #### SequenceImpl

          public SequenceImpl(DataDefinition dataDefinition)
                       throws NullPointerException

      Creates and initializes a new sequence, which combines an ordered list of `segments` and `transitions`.

      Parameters:
        `dataDefinition` - Kind of data represented by this component.
      Throws:
        `NullPointerException` - Data definition is `null`.

  - ### Method Detail

    - #### getComponentObjects

          @MediaProperty(uuid1=100729092,
                         uuid2=1545,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="ComponentObjects",
                         aliases="Components",
                         typeName="ComponentStrongReferenceVector",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=4097,
                         symbol="ComponentObjects")
          public List<Component> getComponentObjects()

      Description copied from interface: `Sequence`

      Returns a list of all the components of this sequence.

      Specified by:
        `getComponentObjects` in interface `Sequence`
      Returns:
        Shallow copy of the list containing all of the components of the sequence.
      See Also:
        `TypeDefinitions.ComponentStrongReferenceVector`

    - #### initializeComponentObjects

          public static final List<Component> initializeComponentObjects()

    - #### appendComponentObject

          @MediaListAppend(value="ComponentObjects")
          public void appendComponentObject(Component componentObject)
                                                                                throws NullPointerException,
                                                                                       InvalidDataDefinitionException,
                                                                                       LeadingTransitionException,
                                                                                       EventSemanticsException,
                                                                                       BadPropertyException,
                                                                                       BadLengthException,
                                                                                       AdjacentTransitionException,
                                                                                       InsufficientTransitionMaterialException

      Description copied from interface: `Sequence`

      Appends the given component to this sequence. The length of the sequence is incremented by the size of the component or transition.

      If the component is to be the first in the sequence and is a transition, the method fails with a `LeadingTransitionException` as it is not acceptable to have a transition as the first element of a sequence. Note that this method supports the incremental creation of sequences from start to finish and so could be used to create a sequence that ends in a transition, which is an illegal state.

      The method checks that the data definition of the appended component is compatible with that of the sequence.

      Specified by:
        `appendComponentObject` in interface `Sequence`
      Parameters:
        `componentObject` - Component to append to this sequence.
      Throws:
        `NullPointerException` - The given component is `null`.
        `InvalidDataDefinitionException` - The kind of data of the component is not compatible with the data definition of the sequence.
        `LeadingTransitionException` - A transition cannot be appended to a sequence so as to become its first component.
        `EventSemanticsException` - The given component is an event that either: does not match the other kinds of event in the sequence; does not have the contextual position property set; does not follow on from the previous event.
        `BadPropertyException` - The given non-event component does not have a length value set.
        `BadLengthException` - The length of the given components is negative.
        `AdjacentTransitionException` - Appending the given transition component would result in two adjacent transitions.
        `InsufficientTransitionMaterialException` - Appending the given component or transition will result in insufficient material for the last transition in the sequence.
      See Also:
        `Event`

    - #### countComponentObjects

          @MediaPropertyCount(value="ComponentObjects")
          public int countComponentObjects()

      Description copied from interface: `Sequence`

      Returns the number of components in this sequence.

      Specified by:
        `countComponentObjects` in interface `Sequence`
      Returns:
        Number of components in this sequence.

    - #### clearComponentObjects

          @MediaPropertyClear(value="ComponentObjects")
          public void clearComponentObjects()

      Description copied from interface: `Sequence`

      Clear all component objects from the sequence.

      Specified by:
        `clearComponentObjects` in interface `Sequence`

    - #### getComponentObjectAt

          @MediaListGetAt(value="ComponentObjects")
          public Component getComponentObjectAt(int index)
                                                                                   throws IndexOutOfBoundsException

      Description copied from interface: `Sequence`

      Returns the component at the given index through this sequence.

      Specified by:
        `getComponentObjectAt` in interface `Sequence`
      Parameters:
        `index` - Index of component through this sequence
      Returns:
        Component at the given index of this sequence.
      Throws:
        `IndexOutOfBoundsException` - The index is outside the acceptable range for this sequence.

    - #### insertComponentObjectAt

          @MediaListInsertAt(value="ComponentObjects")
          public void insertComponentObjectAt(int index,
                                                                                           Component component)
                                                                                    throws NullPointerException,
                                                                                           IndexOutOfBoundsException,
                                                                                           InvalidDataDefinitionException,
                                                                                           LeadingTransitionException,
                                                                                           AdjacentTransitionException,
                                                                                           InsufficientTransitionMaterialException

      Description copied from interface: `Sequence`

      Insert the given component into this sequence at the given index. The length of the sequence is incremented by the size of the component, unless the component is a transition. Indices of components higher than the given index will be increased by one to accommodate the new component.

      If the component is a transition, the method checks that it is not the first object in the sequence, and that it is not neighbouring another transition. It also verifies that there is enough source material on either side of the transition. Note that this method supports the incremental creation of sequences from start to finish and so could be used to create a sequence that ends in a transition, which is an illegal state.

      The method checks that the `data definition` of the appended component is compatible with that of the sequence.

      Specified by:
        `insertComponentObjectAt` in interface `Sequence`
      Parameters:
        `index` - 0-based index to insert the new component at.
        `component` - Component to insert into the sequence.
      Throws:
        `NullPointerException` - The given component to insert is `null`.
        `IndexOutOfBoundsException` - The index is outside the acceptable range for the sequence.
        `InvalidDataDefinitionException` - The kind of data of the component is not compatible with the data definition of the sequence.
        `LeadingTransitionException` - A transition component cannot be inserted as first element of the sequence.
        `AdjacentTransitionException` - Inserting a transition and the given index will result in two neighbouring transitions, which is not permitted.
        `InsufficientTransitionMaterialException` - Not enough source material exists either side of the given transition for the transition to work.

    - #### prependComponentObject

          @MediaListPrepend(value="ComponentObjects")
          public void prependComponentObject(Component component)
                                                                                  throws NullPointerException,
                                                                                         InvalidDataDefinitionException,
                                                                                         LeadingTransitionException

      Description copied from interface: `Sequence`

      Prepends the given component to this sequence. The length of the sequence is incremented by the size of the component.

      If the component is a transition, the method fails with a `LeadingTransitionException` as it is not acceptable to have a transition as the first element of a sequence. Use `Sequence.insertComponentObjectAt(int, Component)` instead.

      The method checks that the `data definition` of the appended component is compatible with that of the sequence.

      Specified by:
        `prependComponentObject` in interface `Sequence`
      Parameters:
        `component` - Component to prepend to this sequence.
      Throws:
        `NullPointerException` - The given component is `null`.
        `InvalidDataDefinitionException` - The kind of data of the component is not compatible with the data definition of the sequence.
        `LeadingTransitionException` - A transition cannot be appended to a sequence so as to become its first or last component.

    - #### removeComponentObjectAt

          @MediaListRemoveAt(value="ComponentObjects")
          public void removeComponentObjectAt(int index)
                                                                                    throws IndexOutOfBoundsException

      Description copied from interface: `Sequence`

      Removes the component at the given index from this sequence. Components already existing at indices higher than the given index will be moved to the next lower index to accommodate.

      Note that removal of a component from a sequence may result in the sequence being in an illegal state.

      Specified by:
        `removeComponentObjectAt` in interface `Sequence`
      Parameters:
        `index` - Index of component to be removed.
      Throws:
        `IndexOutOfBoundsException` - The index is outside the acceptable range for the sequence.

    - #### getCompositeRushIndicator

          @MediaProperty(uuid1=-1316340416,
                         uuid2=12272,
                         uuid3=16729,
                         uuid4={-106,-117,58,-70,71,101,-119,-97},
                         definedName="Composite rush indicator",
                         symbol="Composite_rush_indicator",
                         aliases="Composite_rush_indicator",
                         typeName="Int32",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=0,
                         prefix="q",
                         namespace="http://www.quantel.com/genQ/extensions")
           @Int32
          public int getCompositeRushIndicator()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         throws PropertyNotPresentException

      Specified by:
        `getCompositeRushIndicator` in interface `QSequence`
      Throws:
        `PropertyNotPresentException`

    - #### setCompositeRushIndicator

          @MediaPropertySetter(value="Composite rush indicator")
          public void setCompositeRushIndicator(@Int32
                                                                                                       Integer compositeRushIndicator)

      Specified by:
        `setCompositeRushIndicator` in interface `QSequence`

    - #### getCompositeRushID

          @MediaProperty(uuid1=-343627627,
                         uuid2=29603,
                         uuid3=19676,
                         uuid4={-110,-102,-103,-21,-32,-110,27,67},
                         definedName="Composite rush id",
                         symbol="Composite_rush_id",
                         aliases="Composite_rush_id",
                         typeName="UTF16String",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=0,
                         prefix="q",
                         namespace="http://www.quantel.com/genQ/extensions")
          public String getCompositeRushID()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              throws PropertyNotPresentException

      Specified by:
        `getCompositeRushID` in interface `QSequence`
      Throws:
        `PropertyNotPresentException`

    - #### setCompositeRushID

          @MediaPropertySetter(value="Composite rush id")
          public void setCompositeRushID(String compositeRushID)

      Specified by:
        `setCompositeRushID` in interface `QSequence`

    - #### getCompositeRushOffset

          @MediaProperty(uuid1=2129586645,
                         uuid2=29370,
                         uuid3=18873,
                         uuid4={-98,-68,-29,-105,-109,47,-119,-63},
                         definedName="Composite rush offset",
                         symbol="Composite_rush_offset",
                         aliases="Composite_rush_offset",
                         typeName="Int64",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=0,
                         prefix="q",
                         namespace="http://www.quantel.com/genQ/extensions")
           @Int64
          public long getCompositeRushOffset()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              throws PropertyNotPresentException

      Specified by:
        `getCompositeRushOffset` in interface `QSequence`
      Throws:
        `PropertyNotPresentException`

    - #### setCompositeRushOffset

          @MediaPropertySetter(value="CompositeRushOffset")
          public void setCompositeRushOffset(@Int64
                                                                                               Long compositeRushOffset)

      Specified by:
        `setCompositeRushOffset` in interface `QSequence`

    - #### clone

          public Sequence clone()

      Description copied from interface: `InterchangeObject`

      Create a cloned copy of this interchange object.

      Specified by:
        `clone` in interface `MediaEntity`
      Specified by:
        `clone` in interface `Component`
      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `Segment`
      Specified by:
        `clone` in interface `Sequence`
      Overrides:
        `clone` in class `SegmentImpl`
      Returns:
        Cloned copy of this interchange object.
      See Also:
        `SegmentImpl.clone()`

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.