Media Authoring
with Java API

tv.amwa.maj.entity
Class Segment

java.lang.Object
  extended by tv.amwa.maj.entity.InterchangeObject
      extended by tv.amwa.maj.entity.Component
          extended by tv.amwa.maj.entity.Segment
All Implemented Interfaces:
Serializable, Cloneable, MAJCommon, Component, InterchangeObject, Segment, XMLSerializable
Direct Known Subclasses:
EdgecodeSegment, EssenceGroup, Event, Filler, NestedScope, OperationGroup, Pulldown, ScopeReference, Selector, Sequence, SourceReferenceSegment, TimecodeSegment, TimecodeStream

@AAFClass(uuid1=218169601,
          uuid2=257,
          uuid3=768,
          uuid4={6,14,43,52,2,6,1,1},
          definedName="Segment",
          description="The Segment class represents a Component that is independent of any surrounding object.")
public abstract class Segment
extends Component
implements Segment, Serializable, Cloneable, MAJCommon

Implements a component that is independent of any surrounding object. Contrast this to a transition which is a component that depends on other components to establish its value.

THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.

Author:
Richard Cartwright
See Also:
Serialized Form

Nested Class Summary
static class Segment.SegmentXMLHandler
           
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.Component
Component.ComponentAttributesXMLHandler, Component.ComponentUserCommentsXMLHandler, Component.ComponentXMLHandler, Component.KLVDataXMLHandler
 
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject
InterchangeObject.InterchangeObjectXMLHandler
 
Field Summary
 
Fields inherited from class tv.amwa.maj.entity.Component
COMPONENT_ITEM
 
Constructor Summary
Segment()
           
 
Method Summary
 Segment clone()
          Creates a cloned copy of this entity.
 TimecodeValue segmentOffsetToTC(long offset)
          Converts the given segment offset to a timecode value.
 long segmentTCToOffset(TimecodeValue timecode, Rational editRate)
          Converts the given timecode and edit rate to a segment offset value.
 void setPropertiesFromInterface(Segment castFrom)
           
 
Methods inherited from class tv.amwa.maj.entity.Component
appendAttribute, appendAttribute, appendComment, appendComment, appendKLVData, appendXMLChildren, countAttributes, countComments, countKLVData, equals, getAttributes, getComments, getDataDefinition, getKLVData, getLength, getLengthPresent, hashCode, removeAttribute, removeComment, removeKLVData, setDataDefinition, setLength, setLengthPresent, 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.Component
appendAttribute, appendAttribute, appendComment, appendComment, appendKLVData, countAttributes, countComments, countKLVData, getAttributes, getComments, getDataDefinition, getKLVData, getLength, removeAttribute, removeComment, removeKLVData, setDataDefinition, setLength
 
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
equals, hashCode, toString
 

Constructor Detail

Segment

public Segment()
Method Detail

setPropertiesFromInterface

public final void setPropertiesFromInterface(Segment castFrom)

segmentOffsetToTC

public TimecodeValue segmentOffsetToTC(long offset)
                                throws TimecodeNotFoundException
Description copied from interface: Segment

Converts the given segment offset to a timecode value.

Specified by:
segmentOffsetToTC in interface Segment
Parameters:
offset - Segment offset to be converted to a timecode.
Returns:
Converted timecode value.
Throws:
TimecodeNotFoundException - The given offset is not available as a timecode value in this segment.
See Also:
Segment.segmentTCToOffset(TimecodeValue, Rational)

segmentTCToOffset

public long segmentTCToOffset(TimecodeValue timecode,
                              Rational editRate)
                       throws NullPointerException,
                              TimecodeNotFoundException,
                              BadSampleOffsetException
Description copied from interface: Segment

Converts the given timecode and edit rate to a segment offset value.

Specified by:
segmentTCToOffset in interface Segment
Parameters:
timecode - Timecode to be converted to an offset.
editRate - Edit rate of the given timecode.
Returns:
Frame offset into the segment.
Throws:
NullPointerException - One or both of the given timecode and/or edit rate is/are null.
TimecodeNotFoundException - The given timecode is not available in this segment.
BadSampleOffsetException - The given timecode is outside the bounds of the timecode values represented by this segment.
See Also:
Segment.segmentOffsetToTC(long)

clone

public Segment clone()
Description copied from interface: MAJCommon

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.

Specified by:
clone in interface MAJCommon
Overrides:
clone in class Object
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.