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

tv.amwa.maj.io.mxf

## Interface PrimerPack

- All Superinterfaces:
    Cloneable, FixedLengthPack, MetadataObject
  All Known Implementing Classes:
    IndexPrimerPackImpl, PrimerPackImpl

      public interface PrimerPack
      extends MetadataObject, FixedLengthPack, Cloneable

  Represents the local primer pack of header metadata required for the local set encoding of metadata objects. Tag-length-value encoding of an objects properties require the resolution of 2-byte tags to full 16-byte keys. The primer pack is the table that allows for that resolution to take place.

  See Also:
    `HeaderMetadata.getPrimerPack()`, `MXFBuilder.readLocalSet(UL, java.nio.ByteBuffer, PrimerPack, java.util.Map, java.util.List)`

- - ### Method Summary

    All Methods Instance Methods Abstract 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.
    `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 interface tv.amwa.maj.io.mxf.FixedLengthPack

      `getPackOrder`

- - ### Method Detail

    - #### getLocalTagEntryBatch

          Set<LocalTagEntry> getLocalTagEntryBatch()

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

      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`

    - #### addLocalTagEntry

          void addLocalTagEntry(LocalTagEntry localTagEntry)
                         throws NullPointerException

      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.

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

    - #### addLocalTagEntry

          void addLocalTagEntry(@UInt16
                                short localTag,
                                AUID uid)
                         throws NullPointerException

      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.

      Parameters:
        `localTag` - Tag to add to the lookup table.
        `uid` - Corresponding key to add to the lookup table.
      Throws:
        `NullPointerException` - Cannot use a `null` key.
      See Also:
        `addLocalTagEntry(LocalTagEntry)`, `addLocalTagEntry(PropertyDefinition)`

    - #### addLocalTagEntry

          void addLocalTagEntry(PropertyDefinition propertyDefinition)
                         throws NullPointerException

      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.

      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:
        `addLocalTagEntry(LocalTagEntry)`, `addLocalTagEntry(short, AUID)`

    - #### countLocalTagEntries

          int countLocalTagEntries()

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

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

    - #### clearLocalTagEntries

          void clearLocalTagEntries()

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

    - #### lookupUID

          AUID lookupUID(@UInt16
                         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.

      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.

    - #### lookupLocalTag

          Short lookupLocalTag(AUID uid)
                        throws NullPointerException

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

      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:
        `lookupLocalTag(PropertyDefinition)`

    - #### lookupLocalTag

          Short lookupLocalTag(PropertyDefinition propertyDefinition)
                        throws NullPointerException

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

      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:
        `addLocalTagEntry(PropertyDefinition)`, `lookupLocalTag(AUID)`

    - #### isLocalTagEntryPresent

          boolean isLocalTagEntryPresent(LocalTagEntry localTagEntry)

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

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

    - #### clone

          PrimerPack clone()

      Create a cloned copy of this primer pack.

      Returns:
        Cloned copy of this primer pack.

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