quicktime.app.image
Class ImageDataSequence

java.lang.Object
  |
  +--quicktime.app.image.ImageDataSequence
All Implemented Interfaces:
Collection, ImageSpec

public class ImageDataSequence
extends java.lang.Object
implements ImageSpec, Collection

A Container class for a collection of objects that have a single image description and a sequence of picture data. The actual members of the ImageDataSequence are EncodedImage objects. This collection is a 1 based collection and is ordered. Typically to iterate over the members the ImageSequencer class is used.

See Also:
ImageSequencer

Constructor Summary
ImageDataSequence()
          Creates an ImageDataSequence with no settings
ImageDataSequence(ImageDescription desc)
          Creates an ImageDataSequence with an initial description
 
Method Summary
 boolean addMember(java.lang.Object member)
          Appends the member to the ImageDataSequence.
 void addToMovie(Movie theMovie, float framesPerSecond)
          This will insert a video track into the supplied movie with all of the image data that is contained in this data sequence at the specified frames per second.
 void append(EncodedImage image)
          Add the image description object to the end of the collection
 ImageDescription getDescription()
          Returns the ImageDescription object that describes the image data in this sequence.
 EncodedImage getImage()
          This method returns the actual image data of the first item in the ImageDataSequence.
 EncodedImage getImage(int index)
          This method returns the actual image data at the specified index.
 EncodedImage getNth(int index)
          Gets the image data object at given position.
 boolean hasMember(java.lang.Object object)
          Returns true if the provided object is a member of the collection.
 void insert(EncodedImage image, int index)
          Add the image data object at the specified index.
 boolean isAppropriate(java.lang.Object object)
          Returns true if the provided object is an appropriate candidate for membership in a collection.
 boolean isEmpty()
          Returns true if the collection contains no members, or false if it has one or more members.
 java.util.Enumeration members()
          Returns an object that will iterate over the elements in the collection.
 void prepend(EncodedImage image)
          Add the image description object as the first item in the collection
 void remove(int i)
          Remove the object at the specified index.
 void removeAll()
          Remove all objects.
 void removeFirst()
          Remove the object at the specified index.
 void removeLast()
          Remove the object at the specified index.
 void removeMember(java.lang.Object member)
          If the object is a member of the collection it is removed.
 ImageSequencer sequence()
          Return a Sequencer to iterate over the members of this sequence.
 void setDescription(ImageDescription desc)
          Sets the ImageDescription object that will describe how the image data objects are to be interpreted by QT.
 int size()
          Determines the number of items.
 java.lang.String toString()
          Return a string representation of this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageDataSequence

public ImageDataSequence()
Creates an ImageDataSequence with no settings

ImageDataSequence

public ImageDataSequence(ImageDescription desc)
Creates an ImageDataSequence with an initial description
Parameters:
desc - the description that will describe the subsequently added image data
Method Detail

getDescription

public ImageDescription getDescription()
Returns the ImageDescription object that describes the image data in this sequence.
Specified by:
getDescription in interface ImageSpec
Returns:
the description

setDescription

public void setDescription(ImageDescription desc)
Sets the ImageDescription object that will describe how the image data objects are to be interpreted by QT.
Parameters:
desc - the new description

getImage

public EncodedImage getImage()
This method returns the actual image data of the first item in the ImageDataSequence.
Specified by:
getImage in interface ImageSpec
Returns:
the image data

getImage

public EncodedImage getImage(int index)
This method returns the actual image data at the specified index. The index is a one based index. An Exception is throw if there was some problem retrieving the data.
Parameters:
index - is the index to the data frame
Returns:
the image data

members

public java.util.Enumeration members()
Returns an object that will iterate over the elements in the collection.
Specified by:
members in interface Collection
Returns:
The iterator.

sequence

public ImageSequencer sequence()
Return a Sequencer to iterate over the members of this sequence.
Returns:
a Sequencer

addMember

public boolean addMember(java.lang.Object member)
Appends the member to the ImageDataSequence. Adds an object to the collection. Returns true if the object is appropriate member of the collection (and thus added) and false if not.
Specified by:
addMember in interface Collection
Parameters:
member - the object that should be added as a member to the collection
Returns:
a boolean.

removeMember

public void removeMember(java.lang.Object member)
If the object is a member of the collection it is removed.
Specified by:
removeMember in interface Collection
Parameters:
member - the object to remove from the collection

isAppropriate

public boolean isAppropriate(java.lang.Object object)
Returns true if the provided object is an appropriate candidate for membership in a collection. The provided QTJava collections use this method to ensure a minimal requirement of Class or Interface instanceof tests to ensure the type of object that can be added to a collection. Some collections can have a protocol that allows an application to further refine and tighten the type of object that is allowed within an individual collection.

The member of an ImageDataSequence is an EncodedImage object.

Specified by:
isAppropriate in interface Collection
Parameters:
object - the object to test
Returns:
true if the supplied object is appropriate for this collection, or false if not
See Also:
DynamicCollection, Protocol

hasMember

public boolean hasMember(java.lang.Object object)
Returns true if the provided object is a member of the collection.
Specified by:
hasMember in interface Collection
Parameters:
member - the object to test for membership
Returns:
a boolean

insert

public void insert(EncodedImage image,
                   int index)
Add the image data object at the specified index. If the index is beyond the end of the collection the image data is appended to the collection.
Parameters:
image - The image data.
index - The position in the sequence to add.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index value is beyond the size of the collection.

prepend

public void prepend(EncodedImage image)
Add the image description object as the first item in the collection
Parameters:
image - The image data to add.

append

public void append(EncodedImage image)
Add the image description object to the end of the collection
Parameters:
image - The image data to add.

remove

public void remove(int i)
Remove the object at the specified index.
Parameters:
i - The position in the sequence to delete.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index value is beyond the size of the collection.

removeFirst

public void removeFirst()
Remove the object at the specified index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index value is beyond the size of the collection.

removeLast

public void removeLast()
Remove the object at the specified index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index value is beyond the size of the collection.

removeAll

public void removeAll()
Remove all objects.

size

public int size()
Determines the number of items.
Specified by:
size in interface Collection
Returns:
The size.

getNth

public EncodedImage getNth(int index)
Gets the image data object at given position.
Parameters:
index - Specifies the position in sequence.
Returns:
the image data.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if index value is beyond the size of the collection.

isEmpty

public boolean isEmpty()
Returns true if the collection contains no members, or false if it has one or more members.
Specified by:
isEmpty in interface Collection
Returns:
a boolean

addToMovie

public void addToMovie(Movie theMovie,
                       float framesPerSecond)
                throws QTException
This will insert a video track into the supplied movie with all of the image data that is contained in this data sequence at the specified frames per second.
Parameters:
theMovie - the movie to add the video track to
framesPerSecond - how many frames per second the image data should be inserted at

toString

public java.lang.String toString()
Return a string representation of this class
Overrides:
toString in class java.lang.Object