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

tv.amwa.maj.model.impl

## Class NestedScopeImpl

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

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

      @MediaClass(uuid1=218169601,
                  uuid2=257,
                  uuid3=2816,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="NestedScope",
                  description="The NestedScope class defines a scope and has an ordered set of Segments.",
                  symbol="NestedScope")
      public class NestedScopeImpl
      extends SegmentImpl
      implements NestedScope, Serializable, Cloneable

  Implements a scope and has an ordered set of segments. Typically, nested scopes are used within composition packages.

  See Also:
    Serialized Form

- - ### Field Summary

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

      `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NestedScopeImpl()`
    `NestedScopeImpl(List<Segment> tracks)` Creates and initializes a nested scope object, which defines a scope and has an ordered set of segments.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `appendSegment(Segment segment)` Append an input segment to the list of segments of this nested scope.
    `void` | `clearSegments()`
    `NestedScope` | `clone()` Create a cloned copy of this interchange object.
    `int` | `countSegments()` Returns the number of segments in the list of segments of this nested scope.
    `List<Segment>` | `getNestedScopeTracks()` Returns the list of segments that make up this nested scope.
    `Segment` | `getSegmentAt(int index)` Returns the segment at the given index through the list of segments in this nested scope.
    `static List<Segment>` | `initializeNestedScopeTracks()`
    `void` | `insertSegmentAt(int index, Segment segment)` Insert an input segment into the list of segments of this nested scope at the given index.
    `void` | `prependSegment(Segment segment)` Prepend an input segment to the list of segments of this nested scope.
    `void` | `removeSegmentAt(int index)` Removes the segment at the given index in the list of segments of this nested scope.

    - ### 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

    - #### NestedScopeImpl

          public NestedScopeImpl()

    - #### NestedScopeImpl

          public NestedScopeImpl(List<Segment> tracks)
                          throws NullPointerException,
                                 BadLengthException,
                                 IllegalArgumentException

      Creates and initializes a nested scope object, which defines a scope and has an ordered set of segments.

      Parameters:
        `tracks` - Ordered set of segments; where the last segment provides the value for the nested scope object itself. The last segment is used to set the data definition and length for this segment.
      Throws:
        `NullPointerException` - The argument is null.
        `BadLengthException` - One or more of the segments in the given list has a length that is different to the length of the last segment.
        `IllegalArgumentException` - The list of tracks is empty and it should contain at least one element.

  - ### Method Detail

    - #### appendSegment

          @MediaListAppend(value="NestedScopeTracks")
          public void appendSegment(Segment segment)
                                                                         throws NullPointerException,
                                                                                InvalidDataDefinitionException,
                                                                                BadLengthException

      Description copied from interface: `NestedScope`

      Append an input segment to the list of segments of this nested scope. The last segment added will be used as the output value of the nested scope. Typically, the given segment contains operations whose inputs are scope references.

      Specified by:
        `appendSegment` in interface `NestedScope`
      Parameters:
        `segment` - Input segment to append to the list of segments in this nested scope.
      Throws:
        `NullPointerException` - The given segment is `null`.
        `InvalidDataDefinitionException` - The given segment will become the value of this nested scope has an incompatible data definition.
        `BadLengthException` - The given segment has a different length from that of this nested scope.

    - #### countSegments

          @MediaPropertyCount(value="NestedScopeTracks")
          public int countSegments()

      Description copied from interface: `NestedScope`

      Returns the number of segments in the list of segments of this nested scope.

      Specified by:
        `countSegments` in interface `NestedScope`
      Returns:
        Number of segments in the list of segments of this nested scope.

    - #### clearSegments

          @MediaPropertyClear(value="NestedScopeTracks")
          public void clearSegments()

    - #### getSegmentAt

          @MediaListGetAt(value="NestedScopeTracks")
          public Segment getSegmentAt(int index)
                                                                          throws IndexOutOfBoundsException

      Description copied from interface: `NestedScope`

      Returns the segment at the given index through the list of segments in this nested scope.

      Specified by:
        `getSegmentAt` in interface `NestedScope`
      Parameters:
        `index` - 0-based index of the segment to return.
      Returns:
        Segment at the given index.
      Throws:
        `IndexOutOfBoundsException` - Index is outside the range acceptable range for the current list of segments of this nested scope.

    - #### getNestedScopeTracks

          @MediaProperty(uuid1=100729092,
                         uuid2=1543,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="NestedScopeTracks",
                         aliases={"Slots","NestedScopeSlots"},
                         typeName="SegmentStrongReferenceVector",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=3073,
                         symbol="NestedScopeTracks")
          public List<Segment> getNestedScopeTracks()

      Description copied from interface: `NestedScope`

      Returns the list of segments that make up this nested scope.

      Specified by:
        `getNestedScopeTracks` in interface `NestedScope`
      Returns:
        Shallow copy of the list of segments of this nested scope.

    - #### initializeNestedScopeTracks

          public static final List<Segment> initializeNestedScopeTracks()

    - #### insertSegmentAt

          @MediaListInsertAt(value="NestedScopeTracks")
          public void insertSegmentAt(int index,
                                                                                    Segment segment)
                                                                             throws NullPointerException,
                                                                                    IndexOutOfBoundsException,
                                                                                    InvalidDataDefinitionException,
                                                                                    BadLengthException

      Description copied from interface: `NestedScope`

      Insert an input segment into the list of segments of this nested scope at the given index. Segments already existing at the given and higher indices will be moved up by one index to accommodate.

      Specified by:
        `insertSegmentAt` in interface `NestedScope`
      Parameters:
        `index` - Index at which the segment is to be inserted into the list of segments of this nested scope.
        `segment` - Segment to be inserted into the list.
      Throws:
        `NullPointerException` - The given segment is `null`.
        `IndexOutOfBoundsException` - Index is outside the range of the indices of the current list.
        `InvalidDataDefinitionException` - The given segment will become the value of this nested scope and has an incompatible data definition.
        `BadLengthException` - The given segment has a different length from that of this nested scope.

    - #### prependSegment

          @MediaListPrepend(value="NestedScopeTracks")
          public void prependSegment(Segment segment)
                                                                           throws NullPointerException,
                                                                                  BadLengthException

      Description copied from interface: `NestedScope`

      Prepend an input segment to the list of segments of this nested scope.

      Specified by:
        `prependSegment` in interface `NestedScope`
      Parameters:
        `segment` - Segment to add at the beginning of the list.
      Throws:
        `NullPointerException` - The given segment is `null`.
        `BadLengthException` - The given segment has a different length from that of this nested scope.

    - #### removeSegmentAt

          @MediaListRemoveAt(value="NestedScopeTracks")
          public void removeSegmentAt(int index)
                                                                             throws IndexOutOfBoundsException,
                                                                                    IllegalArgumentException,
                                                                                    InvalidDataDefinitionException

      Description copied from interface: `NestedScope`

      Removes the segment at the given index in the list of segments of this nested scope. Segments already existing at indices greater than the given index will be moved down by one index to accommodate.

      Specified by:
        `removeSegmentAt` in interface `NestedScope`
      Parameters:
        `index` - Index corresponding to segment to be removed from the list of segments of this nested scope.
      Throws:
        `IndexOutOfBoundsException` - The given index is outside the acceptable range for the current list of segments.
        `InvalidDataDefinitionException` - The removal operation for the given index will result in the value of the nested scope having an incompatible data definition to the nested scope itself.
        `IllegalArgumentException` - Removal of a segment will leave an empty list.

    - #### clone

          public NestedScope 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 `NestedScope`
      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.