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

tv.amwa.maj.io.mxf.impl

## Class IndexPrimerPackImpl

- java.lang.Object
- - tv.amwa.maj.io.mxf.impl.IndexPrimerPackImpl

- All Implemented Interfaces:
    Cloneable, MetadataObject, FixedLengthPack, PrimerPack

      public class IndexPrimerPackImpl
      extends Object
      implements PrimerPack

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexPrimerPackImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addLocalTagEntry(LocalTagEntry localTagEntry)` Add a local tag entry to the lookup table that makes up the tag-to-key lookup table of this primer pack using a local tag entry.
    `void` | `addLocalTagEntry(PropertyDefinition propertyDefinition)` Add a local tag entry based on the given property definition, based on its local identification and globally unique identification.
    `void` | `addLocalTagEntry(short localTag, AUID uid)` Add a local tag entry to the lookup table that makes up the tag-to-key lookup table of this primer pack with the 2-byte tag and key.
    `void` | `clearLocalTagEntries()` Clear the tag-to-key lookup table of this primer pack.
    `PrimerPack` | `clone()` Create a cloned copy of this primer pack.
    `int` | `countLocalTagEntries()` Count the number of local tag entries that make up the tag-to-key lookup table of this primer pack.
    `Set<LocalTagEntry>` | `getLocalTagEntryBatch()` Returns the set of local tag entries that make up the tag-to-key lookup table of this primer pack.
    `String[]` | `getPackOrder()` Returns a list of property names in the order they need to be serialized to a stream.
    `boolean` | `isLocalTagEntryPresent(LocalTagEntry localTagEntry)` Determines if the given tag is present in this lookup table.
    `Short` | `lookupLocalTag(AUID uid)` Lookup the given property identifier and find its local tag in the key-to-tag reverse lookup table of this primer pack.
    `Short` | `lookupLocalTag(PropertyDefinition propertyDefinition)` Lookup the given property's local tag in the key-to-tag reverse lookup table of this primer pack.
    `AUID` | `lookupUID(short localTag)` Lookup the given tag in the tag-to-key lookup table of this primer pack, returning the given key or `null` if the tag is not known.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IndexPrimerPackImpl

          public IndexPrimerPackImpl()

  - ### Method Detail

    - #### addLocalTagEntry

          public void addLocalTagEntry(LocalTagEntry localTagEntry)
                                throws NullPointerException

      Description copied from interface: `PrimerPack`

      Add a local tag entry to the lookup table that makes up the tag-to-key lookup table of this primer pack using a local tag entry.

      Specified by:
        `addLocalTagEntry` in interface `PrimerPack`
      Parameters:
        `localTagEntry` - Local tag entry to add to the lookup table.
      Throws:
        `NullPointerException` - Cannot add a `null` local tag entry.
      See Also:
        `PrimerPack.addLocalTagEntry(short, AUID)`, `PrimerPack.addLocalTagEntry(PropertyDefinition)`

    - #### addLocalTagEntry

          public void addLocalTagEntry(short localTag,
                                       AUID uid)

      Description copied from interface: `PrimerPack`

      Add a local tag entry to the lookup table that makes up the tag-to-key lookup table of this primer pack with the 2-byte tag and key.

      Specified by:
        `addLocalTagEntry` in interface `PrimerPack`
      Parameters:
        `localTag` - Tag to add to the lookup table.
        `uid` - Corresponding key to add to the lookup table.
      See Also:
        `PrimerPack.addLocalTagEntry(LocalTagEntry)`, `PrimerPack.addLocalTagEntry(PropertyDefinition)`

    - #### clearLocalTagEntries

          public void clearLocalTagEntries()

      Description copied from interface: `PrimerPack`

      Clear the tag-to-key lookup table of this primer pack.

      Specified by:
        `clearLocalTagEntries` in interface `PrimerPack`

    - #### countLocalTagEntries

          public int countLocalTagEntries()

      Description copied from interface: `PrimerPack`

      Count the number of local tag entries that make up the tag-to-key lookup table of this primer pack.

      Specified by:
        `countLocalTagEntries` in interface `PrimerPack`
      Returns:
        Number of local tag entries that make up the tag-to-key lookup table of this primer pack.

    - #### getLocalTagEntryBatch

          public Set<LocalTagEntry> getLocalTagEntryBatch()

      Description copied from interface: `PrimerPack`

      Returns the set of local tag entries that make up the tag-to-key lookup table of this primer pack.

      Specified by:
        `getLocalTagEntryBatch` in interface `PrimerPack`
      Returns:
        Set of local tag entries that make up the tag-to-key lookup table of this primer pack.
      See Also:
        `TypeDefinitions.LocalTagEntryReference`, `TypeDefinitions.LocalTagEntryBatch`

    - #### isLocalTagEntryPresent

          public boolean isLocalTagEntryPresent(LocalTagEntry localTagEntry)

      Description copied from interface: `PrimerPack`

      Determines if the given tag is present in this lookup table.

      Specified by:
        `isLocalTagEntryPresent` in interface `PrimerPack`
      Parameters:
        `localTagEntry` - Tag to check for.
      Returns:
        Is the given tag present in this lookup table?

    - #### lookupUID

          public AUID lookupUID(short localTag)

      Description copied from interface: `PrimerPack`

      Lookup the given tag in the tag-to-key lookup table of this primer pack, returning the given key or `null` if the tag is not known.

      Specified by:
        `lookupUID` in interface `PrimerPack`
      Parameters:
        `localTag` - Tag to find and resolve to a key in the lookup table.
      Returns:
        Key corresponding to the tag or `null` if the tag is not known.

    - #### clone

          public PrimerPack clone()

      Description copied from interface: `PrimerPack`

      Create a cloned copy of this primer pack.

      Specified by:
        `clone` in interface `PrimerPack`
      Overrides:
        `clone` in class `Object`
      Returns:
        Cloned copy of this primer pack.

    - #### addLocalTagEntry

          public void addLocalTagEntry(PropertyDefinition propertyDefinition)
                                throws NullPointerException

      Description copied from interface: `PrimerPack`

      Add a local tag entry based on the given property definition, based on its local identification and globally unique identification. The two identifications add an entry to the tag-to-key lookup table that makes up this primer pack.

      Specified by:
        `addLocalTagEntry` in interface `PrimerPack`
      Parameters:
        `propertyDefinition` - Property definition to use to create an entry in the tag-to-key lookup table.
      Throws:
        `NullPointerException` - Cannot use a `null` property definition.
      See Also:
        `PrimerPack.addLocalTagEntry(LocalTagEntry)`, `PrimerPack.addLocalTagEntry(short, AUID)`

    - #### getPackOrder

          public String[] getPackOrder()

      Description copied from interface: `FixedLengthPack`

      Returns a list of property names in the order they need to be serialized to a stream.

      Specified by:
        `getPackOrder` in interface `FixedLengthPack`
      Returns:
        List of property names in the order they need to be serialized.
      See Also:
        `MXFBuilder.readFixedLengthPack(tv.amwa.maj.record.AUID, java.nio.ByteBuffer)`, `MXFBuilder.writeFixedLengthPack(FixedLengthPack, java.nio.ByteBuffer)`

    - #### lookupLocalTag

          public Short lookupLocalTag(AUID uid)
                               throws NullPointerException

      Description copied from interface: `PrimerPack`

      Lookup the given property identifier and find its local tag in the key-to-tag reverse lookup table of this primer pack.

      Specified by:
        `lookupLocalTag` in interface `PrimerPack`
      Parameters:
        `uid` - Identifier to map to a local tag.
      Returns:
        Local tag that corresponds to the given property identifier in this primer pack, or `null` if the identifier is not recognized.
      Throws:
        `NullPointerException` - Cannot find a tag for a `null` value.
      See Also:
        `PrimerPack.lookupLocalTag(PropertyDefinition)`

    - #### lookupLocalTag

          public Short lookupLocalTag(PropertyDefinition propertyDefinition)
                               throws NullPointerException

      Description copied from interface: `PrimerPack`

      Lookup the given property's local tag in the key-to-tag reverse lookup table of this primer pack.

      Specified by:
        `lookupLocalTag` in interface `PrimerPack`
      Parameters:
        `propertyDefinition` - Definition to find the local tag for.
      Returns:
        Local tag in this primer pack for the given property, or `null` if the property cannot be found.
      Throws:
        `NullPointerException` - Cannot find a tag for a `null` value.
      See Also:
        `PrimerPack.addLocalTagEntry(PropertyDefinition)`, `PrimerPack.lookupLocalTag(AUID)`

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