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

tv.amwa.maj.model.impl

## Class EssenceGroupImpl

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

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

      @MediaClass(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.",
                  symbol="EssenceGroup")
      public class EssenceGroupImpl
      extends SegmentImpl
      implements EssenceGroup, Serializable, Cloneable

  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.

  See Also:
    Serialized Form

- - ### Field Summary

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

      `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EssenceGroupImpl()`
    `EssenceGroupImpl(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

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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` | `clearChoices()`
    `EssenceGroup` | `clone()` Create a cloned copy of this interchange object.
    `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.
    `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()` Returns the list of segment choices of this essence group, which identify the alternate representations that may be chosen.
    `SourceReferenceSegment` | `getStillFrame()` Gets the still frame property of this essence group, which identifies the essence for a single-frame image representation of the group.
    `static List<Segment>` | `initializeChoices()`
    `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` | `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.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

    - #### EssenceGroupImpl

          public EssenceGroupImpl()

    - #### EssenceGroupImpl

          public EssenceGroupImpl(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

    - #### appendChoice

          @MediaListAppend(value="Choices")
          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 necessarily meaningful.

      The segment shall either be a source clip or a sequence. If the segment is a sequence, it shall contain only source clip and filler objects.

      Specified by:
        `appendChoice` in interface `EssenceGroup`
      Parameters:
        `choice` - Segment 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

          @MediaPropertyCount(value="Choices")
          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

          @MediaListGetAt(value="Choices")
          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

          @MediaListInsertAt(value="Choices")
          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.

      The segment shall either be a source clip or a sequence. If the segment is a sequence, it shall contain only source clip and filler objects.

      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

          @MediaListPrepend(value="Choices")
          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 necessarily meaningful.

      The segment shall either be a source clip or a sequence. If the segment is a sequence, it shall contain only source clip and filler objects.

      Specified by:
        `prependChoice` in interface `EssenceGroup`
      Parameters:
        `choice` - Segment 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

          @MediaListRemoveAt(value="Choices")
          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.

    - #### clearChoices

          @MediaPropertyClear(value="Choices")
          public void clearChoices()

    - #### getChoices

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

      Description copied from interface: `EssenceGroup`

      Returns the list 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 necessarily meaningful.

      Specified by:
        `getChoices` in interface `EssenceGroup`
      Returns:
        List of segment choices of this essence group.
      See Also:
        `EssenceGroup.getChoiceAt(int)`

    - #### initializeChoices

          public static final List<Segment> initializeChoices()

    - #### getStillFrame

          @MediaProperty(uuid1=100729092,
                         uuid2=520,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="StillFrame",
                         typeName="SourceReferenceStrongReference",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=1282,
                         symbol="StillFrame")
          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.
      See Also:
        `TypeDefinitions.SourceReferenceStrongReference`

    - #### setStillFrame

          @MediaPropertySetter(value="StillFrame")
          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`

    - #### clone

          public EssenceGroup 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 `EssenceGroup`
      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `Segment`
      Overrides:
        `clone` in class `SegmentImpl`
      Returns:
        Cloned copy of this interchange object.

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