Defines {@linkplain java.lang.Enum Java enumerations} representing the enumerations specified in the AAF object specification and other enumerations used across the MAJ API. The enumerations in this package have a fixed number of defined elements, unlike extendible enumerations that can be extended at runtime.
Section 21.2 of the AAF object specification v1.1 specifies a number of enumeration data types. Enumerations are made up of a fixed set of elements with each element represented by a name and an ordinal value. All of these enumerations are represented in this package by a Java enumeration.
As Java enumerations do not have to have an ordinal
value associated with them, the AAF-specified ordinal value is provided through the
{@link tv.amwa.maj.industry.MediaEnumerationValue MediaEnumerationValue} interface that is implemented by all
enumerations. The ordinal value of an element can be retrieved using the
{@link tv.amwa.maj.industry.MediaEnumerationValue#value() value()} method. Some of the enumerations
also provide a static fromOrdinal(int)
method that can be used to return an enumeration element
from its specified ordinal value.
Other enumerations are defined for implementation-specific reasons, such as {@link tv.amwa.maj.enumeration.ByteOrder ByteOrder}. In general, these enumerations provide a convenient way to configure features the API or refer to property values in a user-friendly way.
Extendible enumeration data types do not have a fixed set of specified elements, although a currently known set of built-in elements is provided in section 23.1 of the AAF object specification v1.1. An extendible enumeration element consists of a name and {@linkplain tv.amwa.maj.record.AUID AUID} unique identifier pair, suitable for the representation of reference data sets. The built-in elements are defined in the constant package using the {@linkplain tv.amwa.maj.industry.ExtendibleEnumerationItem extendible enumeration annotation}. Additional elements can be registered with a JVM using the registration methods of the {@linkplain tv.amwa.maj.industry.Warehouse warehouse}.
The original versions of the enumerations of this package were derived from the enum
type definitions in the
existing C-based AAF reference implementation, from file
"AAFTypes.h
". A typical source enum definition looks like the code below:
typedef aafInt32 aafContentScanningType_t; typedef enum _aafContentScanningType_e { kAAFContentScanning_NotKnown = 0, kAAFContentScanning_Progressive = 1, kAAFContentScanning_Interlace = 2, kAAFContentScanning_Mixed = 3 } aafContentScanningType_e;
The following steps have been taken to convert the C-based enum type definitions into Java enumerations, taking advantage of Java's class-based representation of enumerations wherever possible:
aaf
" removed from its start and "_e
"
removed from the end. Where the enumeration is specified in the
AAF object specification then the
name has been matched to that. In the example above, the enumeration name becomes "ContentScanningType
".kAAF
" have been removed from the start of each element name.ContentScanning_
" have been
removed from the element names, for example "Progressive
" instead of
"ContentScanning_Progressive
".The resulting underlying Java code for the {@linkplain tv.amwa.maj.enumeration.ContentScanningType content scanning type} is:
public enum ContentScanningType implements AAFEnumerationValue { NotKnown(0), Progressive(1), Interlace(2), Mixed(3); private int value; private ContentScanningType( int value) { this.value = value; } @Int64 public long value() { return (long) value; } }@see tv.amwa.maj.meta.TypeDefinitionEnumeration @see tv.amwa.maj.meta.TypeDefinitionExtendibleEnumeration