Media Authoring
with Java API

tv.amwa.maj.entity
Interface MAJCommon

All Known Implementing Classes:
AAFFileDescriptor, AES3PCMDescriptor, AIFCDescriptor, AuxiliaryDescriptor, BWFImportDescriptor, CDCIDescriptor, CodecDefinition, CommentMarker, CompositionMob, ConstantValue, ContainerDefinition, ContentStorage, ControlPoint, DataDefinition, DataEssenceDescriptor, DefinitionObject, DescriptiveClip, DescriptiveMarker, Dictionary, DigitalImageDescriptor, EdgecodeSegment, EssenceData, EssenceGroup, Event, EventMobSlot, Filler, FilmDescriptor, GPITrigger, Header, HTMLClip, HTMLDescriptor, Identification, ImportDescriptor, InterpolationDefinition, KLVData, KLVDataDefinition, MasterMob, MPEGVideoDescriptor, MultipleDescriptor, NestedScope, NetworkLocator, OperationDefinition, OperationGroup, Parameter, ParameterDefinition, PCMDescriptor, PhysicalDescriptor, PluginDefinition, Pulldown, RecordingDescriptor, RGBADescriptor, RIFFChunk, ScopeReference, Segment, Selector, Sequence, SoundDescriptor, SourceClip, SourceMob, SourceReferenceSegment, TaggedValue, TaggedValueDefinition, TapeDescriptor, TextClip, TextLocator, TIFFDescriptor, TimecodeSegment, TimecodeStream, TimecodeStream12M, TimelineMobSlot, Transition, VaryingValue, WAVEDescriptor

public interface MAJCommon

Specifies MAJ API-specific common methods implemented by all classes in the entity package. These methods are the common methods from Object, such as to string and hash code, that the MAJ API requires are implemented for all entity classes.

All classes that implement this interface also provide the following services:

  1. A public static castFromInterface() method that takes any interface-compatible implementation of the class and returns a MAJ API-implemented version.
  2. A public setPropertiesFromInterface() method that takes any interface-compatible implementation of the class and uses its property values to set all the values of this class.

Note that it is not possible to enforce the existence of the methods described above using Java interfaces. These are an implementation pattern that is specific to the MAJ API.

Author:
Richard Cartwright
See Also:
InterchangeObject.castFromInterface(tv.amwa.maj.iface.InterchangeObject), MasterMob.setPropertiesFromInterface(tv.amwa.maj.iface.MasterMob)

Method Summary
 Object clone()
          Creates a cloned copy of this entity.
 boolean equals(Object o)
          Tests to see if the given object is equal to this interchange object.
 int hashCode()
          Returns a hash code value for this interchange object.
 String toString()
          Create and return a human-readable string representation of this interchange object.
 

Method Detail

toString

String toString()

Create and return a human-readable string representation of this interchange object.

Overrides:
toString in class Object
Returns:
String representation of this entity value.
See Also:
Object.toString()

hashCode

int hashCode()

Returns a hash code value for this interchange object.

Overrides:
hashCode in class Object
Returns:
Hash code value for this interchange object.
See Also:
Object.hashCode()

equals

boolean equals(Object o)

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.

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

clone

Object clone()

Creates a cloned copy of this entity. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.

This method does not throw a CloneNotSupportedException as all entity values must implement the Cloneable interface. If a cloning error does occur, a null value will be returned but this is very unlikely to happen.

Returns:
Independent clone of this value, which is a deep copy.
See Also:
Object.clone()

Media Authoring
with Java API

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