Media Authoring
with Java API

tv.amwa.maj.iface
Interface Selector

All Superinterfaces:
Component, InterchangeObject, Segment
All Known Implementing Classes:
Selector

public interface Selector
extends Segment

Specifies a selected value of a single segment while preserving references to unused alternatives. A selector represents an editing decision, which is in contrast with an essence group that presents a group of alternative versions of the same essence that the application can choose from, based on the most appropriate or efficient essence format among the alternatives.

The selected item if provided when the selector is created and by calling setSelectedSegment(Segment). Note that the collection of alternates does not contain the selected item. When the selected segment is changed, the segment that has been replaced is automatically added to the collection of alternates.

Author:
Richard Cartwright
See Also:
makeSelector(), EssenceGroup

Method Summary
 void appendAlternateSegment(Segment segment)
          Append the given segment to collection of alternative segments of this selector.
 int countAlternateSegments()
          Returns the number of segments in the collection of alternates of this selector.
 List<? extends Segment> getAlternateSegments()
          Returns a collection of all the segments of the collection of alternates of this selector.
 Segment getSelectedSegment()
          Returns the selected segment of this selector.
 void removeAlternateSegment(Segment segment)
          Removes the given segment from the collection of alternates for this selector.
 void setSelectedSegment(Segment selectedSegment)
          Sets the selected segment of this selector.
 
Methods inherited from interface tv.amwa.maj.iface.Segment
segmentOffsetToTC, segmentTCToOffset
 
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
 

Method Detail

getSelectedSegment

Segment getSelectedSegment()

Returns the selected segment of this selector.

Returns:
Selected segment of this selector.

setSelectedSegment

void setSelectedSegment(Segment selectedSegment)
                        throws NullPointerException,
                               BadLengthException,
                               InvalidDataDefinitionException

Sets the selected segment of this selector. If the selected segment currently exists in the set of alternatives, the selected segment is removed from the set. The segment being replaced is appended to the set of alternatives.

Parameters:
selectedSegment - Selected segment of this selector.
Throws:
NullPointerException - The given selected segment is null.
BadLengthException - The given segment does not have a length that matches the length of this selector.
InvalidDataDefinitionException - The given segment does not have a data definition that is compatible with the essence type of this selector.

appendAlternateSegment

void appendAlternateSegment(Segment segment)
                            throws NullPointerException,
                                   BadLengthException,
                                   InvalidDataDefinitionException

Append the given segment to collection of alternative segments of this selector. This set represents unused segment alternatives. If currently omitted, the alternates optional property is made present by this method.

Parameters:
segment - Segment to append to the collection of alternates of this selector.
Throws:
NullPointerException - The given alternate segment is null.
BadLengthException - The given segment does not have a length that matches the length of this selector.
InvalidDataDefinitionException - The given segment does not have a data definition that is compatible with the essence type of this selector.

countAlternateSegments

@Int32
int countAlternateSegments()

Returns the number of segments in the collection of alternates of this selector. If the alternates property is omitted, this method returns 0.

Returns:
Number of segments in the collection of alternates of this selector.

getAlternateSegments

List<? extends Segment> getAlternateSegments()

Returns a collection of all the segments of the collection of alternates of this selector. If the alternates property is omitted, this method returns an empty list.

Returns:
Shallow copy of the collection of alternates of this selector.

removeAlternateSegment

void removeAlternateSegment(Segment segment)
                            throws NullPointerException,
                                   SegmentNotFoundException

Removes the given segment from the collection of alternates for this selector.

Parameters:
segment - Segment to remove from the collection of alternates of this selector.
Throws:
NullPointerException - The given segment to remove from the list of alternates is null.
SegmentNotFoundException - The given segment is not contained in the list of alternates for this selector.

Media Authoring
with Java API

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