Media Authoring
with Java API

tv.amwa.maj.entity
Class AAFFileDescriptor

java.lang.Object
  extended by tv.amwa.maj.entity.InterchangeObject
      extended by tv.amwa.maj.entity.EssenceDescriptor
          extended by tv.amwa.maj.entity.AAFFileDescriptor
All Implemented Interfaces:
Serializable, Cloneable, MAJCommon, AAFFileDescriptor, EssenceDescriptor, InterchangeObject, XMLSerializable
Direct Known Subclasses:
AIFCDescriptor, DataEssenceDescriptor, DigitalImageDescriptor, HTMLDescriptor, MultipleDescriptor, SoundDescriptor, TIFFDescriptor, WAVEDescriptor

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=9472,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="FileDescriptor",
          description="The FileDescriptor class describes an essence source that is directly manipulated by an AAF application.")
public abstract class AAFFileDescriptor
extends EssenceDescriptor
implements AAFFileDescriptor, Serializable, MAJCommon

Implements a file descriptor that describes an essence source that is directly manipulated by an AAF application.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class AAFFileDescriptor.FileDescriptorXMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.EssenceDescriptor
EssenceDescriptor.EssenceDescriptorXMLHandler, EssenceDescriptor.LocatorXMLHandler, EssenceDescriptor.SubDescriptorXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject
InterchangeObject.InterchangeObjectXMLHandler
 
Field Summary
static String FILEDESCRIPTOR_ITEM
           
 
Fields inherited from class tv.amwa.maj.entity.EssenceDescriptor
ESSENCEDESCRIPTOR_ITEM
 
Constructor Summary
AAFFileDescriptor()
           
 
Method Summary
 void appendXMLChildren(Node parent)
          Append child elements to the given parent node to serialize the value of an object to an XML fragment.
 boolean describesStaticEssence()
          Determines whether this file descriptor describes static or time-varying essence.
 boolean equals(Object o)
          Tests to see if the given object is equal to this interchange object.
 CodecDefinition getCodecDefinition()
          Returns the codec of the described file, which identifies the mechanism used to compress and uncompress samples of essence or used to convert samples of essence from one format to another.
 ContainerDefinition getContainerFormat()
          Returns the file format of the described file, which identifies the container mechanism used to store the essence.
 long getLength()
          Returns the length of the essence in sample units (not edit units).
 int getLinkedSlotID()
          Returns the linked slot id of this file descriptor, which specifies which mob slot of the associated source mob this descriptor describes when the source mob is described by a multiple descriptor.
 Rational getSampleRate()
          Returns the sample rate of the essence.
 int hashCode()
          Returns a hash code value for this interchange object.
 void setCodecDefinition(CodecDefinition codecDefinition)
          Set the codec of the described file, which identifies the mechanism used to compress and uncompress samples of essence or used to convert samples of essence from one format to another.
 void setContainerFormat(ContainerDefinition format)
          Specifies the file format of the described file, which identifies the container mechanism used to store the essence.
 void setDescribesStaticEssence()
          Sets this file descriptor so that it describes static essence.
 void setDescribesTimeVaryingEssence(Rational sampleRate, long length)
          Sets this file descriptor so that it describes time varying essence.
 void setLength(long length)
          Sets the length of the essence in sample units (not edit units).
 void setLinkedSlotID(Integer linkedSlotID)
          Set the linked slot id of this file descriptor, which specifies which mob slot of the associated source mob this descriptor describes when the source mob is described by a multiple descriptor.
 void setPropertiesFromInterface(AAFFileDescriptor castFrom)
           
 void setSampleRate(Rational rate)
          Sets sample rate of the essence.
 
Methods inherited from class tv.amwa.maj.entity.EssenceDescriptor
appendLocator, appendSubDescriptor, clone, countLocators, countSubDescriptors, getLocatorAt, getLocators, getSubDescriptorAt, getSubDescriptors, insertLocatorAt, insertSubDescriptorAt, prependLocator, prependSubDescriptor, removeLocatorAt, removeSubDescriptorAt, setPropertiesFromInterface
 
Methods inherited from class tv.amwa.maj.entity.InterchangeObject
castFromInterface, countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, registerImplementation, setPropertiesFromInterface, setPropertyValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface tv.amwa.maj.iface.EssenceDescriptor
appendLocator, appendSubDescriptor, countLocators, countSubDescriptors, getLocatorAt, getLocators, getSubDescriptorAt, getSubDescriptors, insertLocatorAt, insertSubDescriptorAt, prependLocator, prependSubDescriptor, removeLocatorAt, removeSubDescriptorAt
 
Methods inherited from interface tv.amwa.maj.iface.InterchangeObject
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue
 
Methods inherited from interface tv.amwa.maj.entity.MAJCommon
clone, toString
 

Field Detail

FILEDESCRIPTOR_ITEM

public static final String FILEDESCRIPTOR_ITEM
See Also:
Constant Field Values
Constructor Detail

AAFFileDescriptor

public AAFFileDescriptor()
Method Detail

setPropertiesFromInterface

public final void setPropertiesFromInterface(AAFFileDescriptor castFrom)

getCodecDefinition

@AAFProperty(uuid1=100729092,
             uuid2=259,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="CodecDefinition",
             typeName="WeakReference to CodecDefinition",
             optional=true,
             uniqueIdentifier=false,
             pid=12293)
public CodecDefinition getCodecDefinition()
                                   throws PropertyNotPresentException
Description copied from interface: AAFFileDescriptor

Returns the codec of the described file, which identifies the mechanism used to compress and uncompress samples of essence or used to convert samples of essence from one format to another.

Specified by:
getCodecDefinition in interface AAFFileDescriptor
Returns:
Codec used to make the file.
Throws:
PropertyNotPresentException - The optional codec definition property is not present for this file descriptor.

setCodecDefinition

public void setCodecDefinition(CodecDefinition codecDefinition)
Description copied from interface: AAFFileDescriptor

Set the codec of the described file, which identifies the mechanism used to compress and uncompress samples of essence or used to convert samples of essence from one format to another.

Specified by:
setCodecDefinition in interface AAFFileDescriptor
Parameters:
codecDefinition - Codec that was used for the file.
See Also:
CodecDefinition.forName(String), CodecConstant

getContainerFormat

@AAFProperty(uuid1=100729092,
             uuid2=258,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,2},
             definedName="ContainerFormat",
             typeName="WeakReference to ContainerDefinition",
             optional=true,
             uniqueIdentifier=false,
             pid=12292)
public ContainerDefinition getContainerFormat()
                                       throws PropertyNotPresentException
Description copied from interface: AAFFileDescriptor

Returns the file format of the described file, which identifies the container mechanism used to store the essence.

The container format is defined as an optional property but version 1.1 of the AAF object specification requires it to be specified for each file. However, file descriptors created with tools supporting earlier versions of the AAF specification may omit the property, in which case a PropertyNotPresentException is thrown.

Specified by:
getContainerFormat in interface AAFFileDescriptor
Returns:
File format of the described file.
Throws:
PropertyNotPresentException - The (rarely) optional container format property is not present in this file descriptor.

setContainerFormat

public void setContainerFormat(ContainerDefinition format)
Description copied from interface: AAFFileDescriptor

Specifies the file format of the described file, which identifies the container mechanism used to store the essence.

The container format is defined as an optional property but version 1.1 of the AAF object specification requires it to be specified for each file. The property can be omitted by setting its value to null for compatibility with older versions of the specification.

Specified by:
setContainerFormat in interface AAFFileDescriptor
Parameters:
format - File format to set for this file descriptor.
See Also:
ContainerDefinition.forName(String), ContainerConstant

getLength

@AAFProperty(uuid1=67502338,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,1},
             definedName="Length",
             typeName="LengthType",
             optional=false,
             uniqueIdentifier=false,
             pid=12290)
public long getLength()
               throws BadPropertyException
Description copied from interface: AAFFileDescriptor

Returns the length of the essence in sample units (not edit units).

Specified by:
getLength in interface AAFFileDescriptor
Returns:
Length of essence in samples.
Throws:
BadPropertyException - The length property is not present as this file descriptor describes static essence.

setLength

public void setLength(long length)
               throws BadPropertyException,
                      BadLengthException
Description copied from interface: AAFFileDescriptor

Sets the length of the essence in sample units (not edit units).

Specified by:
setLength in interface AAFFileDescriptor
Parameters:
length - Length of the essence in samples.
Throws:
BadPropertyException - The length property is not present as this file descriptor describes static essence.
BadLengthException - The length of the described material is negative.

getSampleRate

@AAFProperty(uuid1=67502337,
             uuid2=0,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,1},
             definedName="SampleRate",
             typeName="Rational",
             optional=false,
             uniqueIdentifier=false,
             pid=12289)
public Rational getSampleRate()
                       throws BadPropertyException
Description copied from interface: AAFFileDescriptor

Returns the sample rate of the essence.

Specified by:
getSampleRate in interface AAFFileDescriptor
Returns:
Sample rate of the essence.
Throws:
BadPropertyException - The sample rate property is not present as this file descriptor describes static essence.

setSampleRate

public void setSampleRate(Rational rate)
                   throws NullPointerException,
                          BadPropertyException
Description copied from interface: AAFFileDescriptor

Sets sample rate of the essence.

Specified by:
setSampleRate in interface AAFFileDescriptor
Parameters:
rate - Sample rate of the essence.
Throws:
NullPointerException - The given sample rate is null.
BadPropertyException - The sample rate property is not present as this file descriptor describes static essence.

describesStaticEssence

public boolean describesStaticEssence()

Determines whether this file descriptor describes static or time-varying essence. This method returns true if static essence is described and false if time-varying essence is described. If the file descriptor describes static essence then the sample rate and length properties are not present.

Returns:
Does this file descriptor describe static essence?

setDescribesStaticEssence

public void setDescribesStaticEssence()

Sets this file descriptor so that it describes static essence.


setDescribesTimeVaryingEssence

public void setDescribesTimeVaryingEssence(Rational sampleRate,
                                           long length)
                                    throws NullPointerException,
                                           BadLengthException

Sets this file descriptor so that it describes time varying essence. In this state, the sample rate and length properties are required and so must be provided to the call to this method.

Parameters:
sampleRate - Sample rate for this file descriptor.
length - Length of the material represented by this file descriptor.
Throws:
NullPointerException - Argument is null.
BadLengthException - The length of the described material is negative.

getLinkedSlotID

@AAFProperty(uuid1=100729091,
             uuid2=1280,
             uuid3=0,
             uuid4={6,14,43,52,1,1,1,5},
             definedName="LinkedSlotID",
             typeName="UInt32",
             optional=true,
             uniqueIdentifier=false,
             pid=12294)
public int getLinkedSlotID()
                    throws PropertyNotPresentException
Description copied from interface: AAFFileDescriptor

Returns the linked slot id of this file descriptor, which specifies which mob slot of the associated source mob this descriptor describes when the source mob is described by a multiple descriptor. This is an optional property.

Specified by:
getLinkedSlotID in interface AAFFileDescriptor
Returns:
Linked slot id of this file descriptor.
Throws:
PropertyNotPresentException - The optional linked slot id property is not present in this file descriptor.

setLinkedSlotID

public void setLinkedSlotID(Integer linkedSlotID)
                     throws IllegalArgumentException
Description copied from interface: AAFFileDescriptor

Set the linked slot id of this file descriptor, which specifies which mob slot of the associated source mob this descriptor describes when the source mob is described by a multiple descriptor. In this case, this file descriptor is one of the collection of file descriptors that are part of a multiple descriptor, as returned by MultipleDescriptor.getFileDescriptors(). If this file descriptor is not part of a multiple descriptor collection, set this optional property to null to omit it.

Specified by:
setLinkedSlotID in interface AAFFileDescriptor
Parameters:
linkedSlotID - Linked slot id of this file descriptor.
Throws:
IllegalArgumentException - The linked slot id is negative.

equals

public boolean equals(Object o)
Description copied from interface: MAJCommon

Tests to see if the given object is equal to this interchange object. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.

Specified by:
equals in interface MAJCommon
Overrides:
equals in class EssenceDescriptor
Parameters:
o - Object to test for equality with.
Returns:
Is the given object equals to this value?
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Description copied from interface: MAJCommon

Returns a hash code value for this interchange object.

Specified by:
hashCode in interface MAJCommon
Overrides:
hashCode in class EssenceDescriptor
Returns:
Hash code value for this interchange object.
See Also:
Object.hashCode()

appendXMLChildren

public void appendXMLChildren(Node parent)
Description copied from interface: XMLSerializable

Append child elements to the given parent node to serialize the value of an object to an XML fragment. Methods of the XMLBuilder class are provided to help with this process.

Specified by:
appendXMLChildren in interface XMLSerializable
Overrides:
appendXMLChildren in class EssenceDescriptor
Parameters:
parent - XML parent element to append child nodes to.

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.