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

tv.amwa.maj.io.mxf

## Interface PartitionPack

- All Superinterfaces:
    Cloneable, MetadataObject, MXFUnit, Padded
  All Known Subinterfaces:
    BodyClosedCompletePartitionPack, BodyClosedIncompletePartitionPack, BodyOpenCompletePartitionPack, BodyOpenIncompletePartitionPack, BodyPartitionPack, FooterClosedCompletePartitionPack, FooterClosedIncompletePartitionPack, FooterPartitionPack, HeaderClosedCompletePartitionPack, HeaderClosedIncompletePartitionPack, HeaderOpenCompletePartitionPack, HeaderOpenIncompletePartitionPack, HeaderPartitionPack
  All Known Implementing Classes:
    BodyClosedCompletePartitionPackImpl, BodyClosedIncompletePartitionPackImpl, BodyOpenCompletePartitionPackImpl, BodyOpenIncompletePartitionPackImpl, BodyPartitionPackImpl, FooterClosedCompletePartitionPackImpl, FooterClosedIncompletePartitionPackImpl, FooterPartitionPackImpl, HeaderClosedCompletePartitionPackImpl, HeaderClosedIncompletePartitionPackImpl, HeaderOpenCompletePartitionPackImpl, HeaderOpenIncompletePartitionPackImpl, HeaderPartitionPackImpl, PartitionPackImpl

      public interface PartitionPack
      extends MetadataObject, Cloneable, MXFUnit, Padded

  Represents a partition pack that describes and starts every partition of an MXF file. The description includes:

  - the size of each of the partitions constituent parts;
  - the partitions offset in the overall file, measured from the beginning of the header partition;
  - the identities of any index or body streams contained in the partition;
  - some additional information that may be of use to a decoder, such as operational pattern and kinds of essence found in the partition.

  With the exception of the body offset, all byte offsets are measured from the start of the header partition. If the file has no run-in, this is the first byte of the file.

  The header partition starts at the end of the partition pack, found when decoding the length of the KLV data set that represents the parition pack. The index table starts at the end of the partition pack plus the size of any header metadata.

  See Also:
    `Partition.getPartitionPack()`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BODYSID_DEFAULT` Default value for the identity of any stream of essence (body) in this partition, which is 0.
    `static long` | `FOOTERPARTITION_DEFAULT` Default value for the byte offset to the beginning of the footer partition, which is 0L.
    `static long` | `HEADERBYTECOUNT_DEFAULT` Default value for the size of any header metadata in the partition, which is 0L.
    `static long` | `INDEXBYTECOUNT_DEFAULT` Default value for the size of any index table data in the partition, which is 0L.
    `static int` | `INDEXSID_DEFAULT` Default value for the identity of any stream of index table data in this partition, which is 0.
    `static short` | `MAJORVERSION_DEFAULT` Default value for the major version property, which is 1.
    `static short` | `MINORVERSION_DEFAULT` Default value for the minor version property, which is 3.
    `static long` | `PREVIOUSPARTITION_DEFAULT` Default value for the byte offset from the start of the file to the beginning of the previous partition, which is 0L.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEssenceContainer(AUID essenceContainerID)` Add an identifier for the kinds of essence found in or referenced by the MXF file containing this partition.
    `PartitionPack` | `clone()` Create a cloned copy of this partition pack.
    `long` | `getBodyOffset()` Returns the byte offset to the essence container in this partition from the start of the partition pack.
    `int` | `getBodySID()` Returns the identifier of the essence container in this partition.
    `int` | `getEncodedSize()` Calculates the number of bytes it will take to encode this partition pack.
    `Set<AUID>` | `getEssenceContainers()` Returns a set of identifiers for the kinds of essence found in or referenced by the MXF file containing this partition.
    `long` | `getFooterPartition()` Returns the byte offset of the footer partition in the file.
    `long` | `getHeaderByteCount()` Returns the number of bytes used for header metadata in this partition.
    `long` | `getIndexByteCount()` Returns the number of bytes used for index table segments in this partition.
    `int` | `getIndexSID()` Returns the identifier of index table segments in this partition.
    `int` | `getKagSize()` Returns the key alignment grid size for KLV data triplets in this partition.
    `short` | `getMajorVersion()` Returns the major version number of the MXF byte-level format.
    `short` | `getMinorVersion()` Returns the minor version number of the MXF byte-level format.
    `AUID` | `getOperationalPattern()` Returns the operational pattern of the MXF file.
    `long` | `getPreviousPartition()` Returns the byte offset of the previous partition in the file.
    `long` | `getThisPartition()` Returns the byte offset of this partition in the file.
    `void` | `setBodyOffset(long bodyOffset)` Sets byte offset to the essence container in this partition from the start of the partition pack.
    `void` | `setBodySID(int bodySID)` Sets the identifier of the essence container in this partition.
    `void` | `setEssenceContainers(Set<AUID> essenceContainers)` Sets a set of identifiers for the kinds of essence found in or referenced by the MXF file containing this partition.
    `void` | `setFooterPartition(long footerPartition)` Sets the byte offset of the footer partition in the file.
    `void` | `setHeaderByteCount(long headerByteCount)` Sets the number of bytes used for header metadata in this partition.
    `void` | `setIndexByteCount(long indexByteCount)` Sets the number of bytes used for index table segments in this partition.
    `void` | `setIndexSID(int indexSID)` Sets the identifier of index table segments in this partition.
    `void` | `setKagSize(int kagSize)` Sets the key alignment grid size for KLV data triplets in this partition.
    `void` | `setMajorVersion(short majorVersion)` Sets the major version number of the MXF byte-level format.
    `void` | `setMinorVersion(short minorVersion)` Sets the minor version number of the MXF byte-level format.
    `void` | `setOperationalPattern(AUID auid)` Sets the operational pattern of the MXF file containing this partition.
    `void` | `setPreviousPartition(long previousPartition)` Sets the byte offset of the previous partition in the file to this one.
    `void` | `setThisPartition(long thisPartition)` Returns the byte offset of this partition in the file.

    - ### Methods inherited from interface tv.amwa.maj.io.mxf.MXFUnit

      `getUnitType`

    - ### Methods inherited from interface tv.amwa.maj.io.mxf.Padded

      `getPaddingFillSize, setPaddingFillSize`

- - ### Field Detail

    - #### MAJORVERSION_DEFAULT

          static final short MAJORVERSION_DEFAULT

      Default value for the major version property, which is 1.

      See Also:
        `getMajorVersion()`, `setMajorVersion(short)`, Constant Field Values

    - #### MINORVERSION_DEFAULT

          static final short MINORVERSION_DEFAULT

      Default value for the minor version property, which is 3.

      See Also:
        `getMinorVersion()`, `setMinorVersion(short)`, Constant Field Values

    - #### PREVIOUSPARTITION_DEFAULT

          static final long PREVIOUSPARTITION_DEFAULT

      Default value for the byte offset from the start of the file to the beginning of the previous partition, which is 0L.

      See Also:
        `getPreviousPartition()`, `setPreviousPartition(long)`, Constant Field Values

    - #### FOOTERPARTITION_DEFAULT

          static final long FOOTERPARTITION_DEFAULT

      Default value for the byte offset to the beginning of the footer partition, which is 0L.

      See Also:
        Constant Field Values

    - #### HEADERBYTECOUNT_DEFAULT

          static final long HEADERBYTECOUNT_DEFAULT

      Default value for the size of any header metadata in the partition, which is 0L. A value of zero indicates that no header metadata is present in this partition.

      See Also:
        `getHeaderByteCount()`, `setHeaderByteCount(long)`, Constant Field Values

    - #### INDEXBYTECOUNT_DEFAULT

          static final long INDEXBYTECOUNT_DEFAULT

      Default value for the size of any index table data in the partition, which is 0L.

      See Also:
        `getIndexByteCount()`, `setIndexByteCount(long)`, Constant Field Values

    - #### INDEXSID_DEFAULT

          static final int INDEXSID_DEFAULT

      Default value for the identity of any stream of index table data in this partition, which is 0. A value of zero indicates that no index table data is present for this partition.

      See Also:
        `getIndexSID()`, `setIndexSID(int)`, Constant Field Values

    - #### BODYSID_DEFAULT

          static final int BODYSID_DEFAULT

      Default value for the identity of any stream of essence (body) in this partition, which is 0. A value of zero indicates that no essence container data is present for this partition.

      See Also:
        `getBodySID()`, `setBodySID(int)`, Constant Field Values

  - ### Method Detail

    - #### getMajorVersion

          @UInt16
          short getMajorVersion()

      Returns the major version number of the MXF byte-level format. A change in number is a warning that the file may not be backward compatible.

      Returns:
        Major version number of the MXF byte-level format.
      See Also:
        `MAJORVERSION_DEFAULT`, `getMinorVersion()`

    - #### setMajorVersion

          void setMajorVersion(@UInt16
                               short majorVersion)

      Sets the major version number of the MXF byte-level format. A change in number is a warning that the file may not be backward compatible.

      Parameters:
        `majorVersion` - Major version number of the MXF byte-level format.
      See Also:
        `MAJORVERSION_DEFAULT`, `setMinorVersion(short)`

    - #### getMinorVersion

          @UInt16
          short getMinorVersion()

      Returns the minor version number of the MXF byte-level format. Newer versions indicated by this number should be backward-compatible with previous versions.

      Returns:
        Minor version number of the MXF byte-level format.
      See Also:
        `MINORVERSION_DEFAULT`, `getMajorVersion()`

    - #### setMinorVersion

          void setMinorVersion(@UInt16
                               short minorVersion)

      Sets the minor version number of the MXF byte-level format. Newer versions indicated by this number should be backward-compatible with previous versions.

      Parameters:
        `minorVersion` - Minor version number of the MXF byte-level format.
      See Also:
        `MINORVERSION_DEFAULT`, `setMajorVersion(short)`

    - #### getKagSize

          @UInt32
          int getKagSize()

      Returns the key alignment grid size for KLV data triplets in this partition.

      Returns:
        Key alignment grid size for KLV data triplets in this partition.

    - #### setKagSize

          void setKagSize(@UInt32
                          int kagSize)

      Sets the key alignment grid size for KLV data triplets in this partition.

      Parameters:
        `kagSize` - Key alignment grid size for KLV data triplets in this partition.

    - #### getThisPartition

          @UInt64
          long getThisPartition()

      Returns the byte offset of this partition in the file.

      Returns:
        Byte offset of this partition in the file.
      See Also:
        `getPreviousPartition()`, `getFooterPartition()`

    - #### setThisPartition

          void setThisPartition(@UInt64
                                long thisPartition)

      Returns the byte offset of this partition in the file.

      Parameters:
        `thisPartition` - Byte offset of this partition in the file.
      See Also:
        `setPreviousPartition(long)`, `setFooterPartition(long)`

    - #### getPreviousPartition

          @UInt64
          long getPreviousPartition()

      Returns the byte offset of the previous partition in the file.

      Returns:
        Byte offset of the previous partition in the file.
      See Also:
        `PREVIOUSPARTITION_DEFAULT`, `getThisPartition()`, `getFooterPartition()`

    - #### setPreviousPartition

          void setPreviousPartition(@UInt64
                                    long previousPartition)

      Sets the byte offset of the previous partition in the file to this one.

      Parameters:
        `previousPartition` - byte offset of the previous partition in the file to this one.
      See Also:
        `PREVIOUSPARTITION_DEFAULT`, `setPreviousPartition(long)`, `setThisPartition(long)`

    - #### getFooterPartition

          @UInt64
          long getFooterPartition()

      Returns the byte offset of the footer partition in the file.

      Returns:
        Byte offset of the footer partition in the file.
      See Also:
        `FOOTERPARTITION_DEFAULT`, `getThisPartition()`, `getPreviousPartition()`

    - #### setFooterPartition

          void setFooterPartition(@UInt64
                                  long footerPartition)

      Sets the byte offset of the footer partition in the file.

      Parameters:
        `footerPartition` - Byte offset of the footer partition in the file.
      See Also:
        `FOOTERPARTITION_DEFAULT`, `setThisPartition(long)`, `setPreviousPartition(long)`

    - #### getHeaderByteCount

          @UInt64
          long getHeaderByteCount()

      Returns the number of bytes used for header metadata in this partition. The value includes any primer pack, metadata sets and trailing fill. A value of zero indicates that no header metadata is present in this partition.

      Returns:
        Number of bytes used for header metadata in this partition.
      See Also:
        `HEADERBYTECOUNT_DEFAULT`

    - #### setHeaderByteCount

          void setHeaderByteCount(@UInt64
                                  long headerByteCount)

      Sets the number of bytes used for header metadata in this partition. The value includes any primer pack, metadata sets and trailing fill. A value of zero indicates that no header metadata is present in this partition.

      Parameters:
        `headerByteCount` - Number of bytes used for header metadata in this partition.
      See Also:
        `HEADERBYTECOUNT_DEFAULT`, `setIndexByteCount(long)`

    - #### getIndexByteCount

          @UInt64
          long getIndexByteCount()

      Returns the number of bytes used for index table segments in this partition. This includes the key for the first index table segment and any trailing fill.

      Note that the presence of absence of index table data is determined from the index SID value.

      Returns:
        Number of bytes used for header metadata in this partition.
      See Also:
        `INDEXBYTECOUNT_DEFAULT`, `getHeaderByteCount()`, `getIndexSID()`

    - #### setIndexByteCount

          void setIndexByteCount(@UInt64
                                 long indexByteCount)

      Sets the number of bytes used for index table segments in this partition. This includes the key for the first index table segment and any trailing fill.

      Note that the presence of absence of index table data is determined from the index SID value.

      Parameters:
        `indexByteCount` - Number of bytes used for header metadata in this partition.
      See Also:
        `INDEXBYTECOUNT_DEFAULT`, `setHeaderByteCount(long)`

    - #### getIndexSID

          @UInt32
          int getIndexSID()

      Returns the identifier of index table segments in this partition. A value of zero indicates that no index table data is present for this partition.

      Returns:
        Identifier of index table segments in this partition.
      See Also:
        `INDEXSID_DEFAULT`, `getIndexByteCount()`

    - #### setIndexSID

          void setIndexSID(int indexSID)

      Sets the identifier of index table segments in this partition. A value of zero indicates that no index table data is present for this partition.

      Parameters:
        `indexSID` - Identifier of index table segments in this partition.
      See Also:
        `INDEXSID_DEFAULT`, `setIndexByteCount(long)`

    - #### getBodyOffset

          @UInt64
          long getBodyOffset()

      Returns the byte offset to the essence container in this partition from the start of the partition pack.

      Returns:
        Byte offset to the essence container in this partition from the start of the partition pack.
      See Also:
        `getBodySID()`

    - #### setBodyOffset

          void setBodyOffset(@UInt64
                             long bodyOffset)

      Sets byte offset to the essence container in this partition from the start of the partition pack.

      Parameters:
        `bodyOffset` - Byte offset to the essence container in this partition from the start of the partition pack.
      See Also:
        `setBodySID(int)`

    - #### getBodySID

          @UInt32
          int getBodySID()

      Returns the identifier of the essence container in this partition. A value of zero indicates that no essence container data is present for this partition.

      Returns:
        Identifier of the essence container in this partition.
      See Also:
        `BODYSID_DEFAULT`, `getIndexSID()`, `getBodyOffset()`

    - #### setBodySID

          void setBodySID(@UInt32
                          int bodySID)

      Sets the identifier of the essence container in this partition. A value of zero indicates that no essence container data is present for this partition.

      Parameters:
        `bodySID` - Identifier of the essence container in this partition.
      See Also:
        `BODYSID_DEFAULT`, `setIndexSID(int)`, `setBodyOffset(long)`

    - #### getOperationalPattern

          AUID getOperationalPattern()

      Returns the operational pattern of the MXF file.

      Returns:
        Operational pattern of the MXF file.
      See Also:
        `Preface.getOperationalPattern()`, `OperationalPatternConstant`

    - #### setOperationalPattern

          void setOperationalPattern(AUID auid)

      Sets the operational pattern of the MXF file containing this partition.

      Parameters:
        `auid` - Operational pattern of the MXF file.
      See Also:
        `Preface.setOperationalPattern(AUID)`, `OperationalPatternConstant`

    - #### getEssenceContainers

          Set<AUID> getEssenceContainers()

      Returns a set of identifiers for the kinds of essence found in or referenced by the MXF file containing this partition.

      Returns:
        Set of identifiers for the kinds of essence found in or referenced by the MXF file.
      See Also:
        `addEssenceContainer(AUID)`, `Preface.getEssenceContainers()`, `ContainerConstant`, `ContainerDefinition`

    - #### setEssenceContainers

          void setEssenceContainers(Set<AUID> essenceContainers)

      Sets a set of identifiers for the kinds of essence found in or referenced by the MXF file containing this partition.

      Parameters:
        `essenceContainers` - Set of identifiers for the kinds of essence found in or referenced by the MXF file.
      See Also:
        `addEssenceContainer(AUID)`, `Preface.getEssenceContainers()`, `ContainerConstant`, `ContainerDefinition`

    - #### addEssenceContainer

          void addEssenceContainer(AUID essenceContainerID)
                            throws NullPointerException

      Add an identifier for the kinds of essence found in or referenced by the MXF file containing this partition.

      Parameters:
        `essenceContainerID` - Identifier for a kind of essence found of referenced by the MXF file.
      Throws:
        `NullPointerException` - Cannot add a `null` identifier to the set of container essence types.
      See Also:
        `getEssenceContainers()`, `Preface.getEssenceContainers()`, `ContainerConstant`, `ContainerDefinition`

    - #### getEncodedSize

          int getEncodedSize()

      Calculates the number of bytes it will take to encode this partition pack.

      Returns:
        Number of bytes required to encode this partition pack.

    - #### clone

          PartitionPack clone()

      Create a cloned copy of this partition pack.

      Returns:
        Cloned copy of this partition pack.

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