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

tv.amwa.maj.record

## Enum InstanceNumberGeneration

- java.lang.Object
- - java.lang.Enum<InstanceNumberGeneration>
  - - tv.amwa.maj.record.InstanceNumberGeneration

- All Implemented Interfaces:
    Serializable, Comparable<InstanceNumberGeneration>

      public enum InstanceNumberGeneration
      extends Enum<InstanceNumberGeneration>

  Describes different methods used to generate the instance number part of a UMID, which forms bytes 14, 15 and 16 of a UMID value. The techniques represented by this enumeration are defined in appendix B of SMPTE 330M-2004. The next instance of a UMID can be generated by calling `PackageID.nextInstance()`.

  To find the corresponding byte value of the instance number generation type, call `getMethodCode()`. The static method `generationMethodFromCode(byte)` converts the byte value code into a value of this enumeration.

  The instance number generation method is encoded within a UMID value. Call `PackageID.getInstanceGenerator()` to find out the kind of instance number generation in use.

  See Also:
    `Forge.generatePackageID(tv.amwa.maj.enumeration.MaterialType, InstanceNumberGeneration, MaterialNumberGeneration)`, `Forge.generatePackageID(tv.amwa.maj.enumeration.MaterialType, InstanceNumberGeneration, MaterialNumberGeneration, AUID)`, `Forge.generatePackageID(tv.amwa.maj.enumeration.MaterialType, InstanceNumberGeneration, MaterialNumberGeneration, byte[])`, `PackageID.nextInstance()`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CopyAndPseudoRandom16Bit` Instance number is generated by incrementing an 8-bit counter alongside a 16-bit pseudo random number generator.
    `LiveStream` Instance number is generated from data from an associated live data stream.
    `LocalRegistration` Local registration where the new instance number count is incremented by one for each new instance.
    `NotDefined` No defined method for instance generation.
    `PseudoRandom24Bit` Instance number is generated using a 24-bit pseudo random number generator.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static InstanceNumberGeneration` | `generationMethodFromCode(byte code)` Converts a numeric code for a instance number generation type into a value of this enumeration, as defined according to table 4 of SMPTE 330M.
    `byte` | `getMethodCode()` Returns the numeric code for the UMID instance number generation type, as defined in table 4 of SMPTE 330M.
    `static InstanceNumberGeneration` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static InstanceNumberGeneration[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### NotDefined

          public static final InstanceNumberGeneration NotDefined

      No defined method for instance generation.

    - #### LocalRegistration

          public static final InstanceNumberGeneration LocalRegistration

      Local registration where the new instance number count is incremented by one for each new instance.

    - #### PseudoRandom24Bit

          public static final InstanceNumberGeneration PseudoRandom24Bit

      Instance number is generated using a 24-bit pseudo random number generator.

    - #### CopyAndPseudoRandom16Bit

          public static final InstanceNumberGeneration CopyAndPseudoRandom16Bit

      Instance number is generated by incrementing an 8-bit counter alongside a 16-bit pseudo random number generator.

    - #### LiveStream

          public static final InstanceNumberGeneration LiveStream

      Instance number is generated from data from an associated live data stream.

  - ### Method Detail

    - #### values

          public static InstanceNumberGeneration[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (InstanceNumberGeneration c : InstanceNumberGeneration.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static InstanceNumberGeneration valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### getMethodCode

          public byte getMethodCode()

      Returns the numeric code for the UMID instance number generation type, as defined in table 4 of SMPTE 330M.

      Returns:
        Numeric code of the instance number generator.

    - #### generationMethodFromCode

          public static final InstanceNumberGeneration generationMethodFromCode(byte code)

      Converts a numeric code for a instance number generation type into a value of this enumeration, as defined according to table 4 of SMPTE 330M.

      Parameters:
        `code` - Numeric ode to convert to an enumeration value.
      Returns:
        Enumeration value corresponding to the code, or `null` if no corresponding enumeration value could be found.

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