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

tv.amwa.maj.io.mxf

## Interface RandomIndexItem

- All Superinterfaces:
    Cloneable, Comparable<RandomIndexItem>
  All Known Implementing Classes:
    RandomIndexItemImpl

      public interface RandomIndexItem
      extends Comparable<RandomIndexItem>, Cloneable

  Entry in a random index pack of an MXF file that indexes the byte offset of a partition in a file. The random index pack is the last data set in an MXF file.

  See Also:
    `RandomIndexPack.getPartitionIndex()`, `RandomIndexPack.addRandomIndexItem(RandomIndexItem)`, `RandomIndexPack.addRandomIndexItem(int, long)`, `TypeDefinitions.RandomIndexItem`, `TypeDefinitions.RandomIndexItemArray`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `RandomIndexItem` | `clone()` Create a cloned copy of this random index item.
    `int` | `compareTo(RandomIndexItem o)` Compares this item to another random index item by byte offset.
    `int` | `getBodySID()` Returns the body stream identifier for the essence container in the partition indexed by this item.
    `long` | `getByteOffset()` Returns the byte offset of the indexed partition in the MXF file.
    `void` | `setBodySID(int bodySID)` Sets the body stream identifier for the essence container in the partition indexed by this item.
    `void` | `setByteOffset(long byteOffset)` Sets the byte offset of the indexed partition in the MXF file.

- - ### Method Detail

    - #### getBodySID

          @UInt32
          int getBodySID()

      Returns the body stream identifier for the essence container in the partition indexed by this item. A value of zero indicates that the partition does not contain a body stream.

      Returns:
        Body stream identifier within the indexed partition.
      See Also:
        `PartitionPack.getBodySID()`

    - #### setBodySID

          void setBodySID(@UInt32
                          int bodySID)
                   throws IllegalArgumentException

      Sets the body stream identifier for the essence container in the partition indexed by this item.

      Parameters:
        `bodySID` - Body stream identifier within the indexed partition.
      Throws:
        `IllegalArgumentException` - Cannot set the body stream identifier to a negative value.
      See Also:
        `PartitionPack.setBodySID(int)`

    - #### getByteOffset

          @UInt64
          long getByteOffset()

      Returns the byte offset of the indexed partition in the MXF file. The byte offset is measured from the start of the header partition.

      Returns:
        Byte offset of the indexed partition.
      See Also:
        `PartitionPack.getThisPartition()`

    - #### setByteOffset

          void setByteOffset(@UInt64
                             long byteOffset)
                      throws IllegalArgumentException

      Sets the byte offset of the indexed partition in the MXF file. The byte offset is measured from the start of the header partition.

      Parameters:
        `byteOffset` - Byte offset of the indexed partition.
      Throws:
        `IllegalArgumentException` - Cannot set the byte offset to a negative value.
      See Also:
        `PartitionPack.setThisPartition(long)`

    - #### compareTo

          int compareTo(RandomIndexItem o)

      Compares this item to another random index item by byte offset. This method returns:

      - `-1` if this item indexes a partition before the given item;
      - `0` if this item is at the same position as the given item;
      - `1` if this item indexes a partition after the given item.
      Specified by:
        `compareTo` in interface `Comparable<RandomIndexItem>`
      Returns:
        If the indexed partition before, at the same position as or after the given partition's position in the MXF file.

    - #### clone

          RandomIndexItem clone()

      Create a cloned copy of this random index item.

      Returns:
        Cloned copy of this random index item.

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