All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface quicktime.app.spaces.Collection

public interface Collection
This interface provide an uniform means of dealing with a collection of Objects in QTJava. Particular implementations of this interface provide both their own storage mechanism and semantics about the default position and characteristics of the addMember method.

The isAppropriate method returns true if the object argument conforms to the type of object that the Collection is a collector of. The addMember implementation will call isAppropriate and returns true if the object is an appropriate member (and is therefore added to the collection).

The individual collection classes explain the customisations and restrictions on membership they enforce.

The type of object that a collection contains is statically determined by the isAppropriate () method. The DynamicCollection extension of Collection provides a mechanism for dynamically customising the membership requirments for individual collections.

See Also:
DynamicCollection

Method Index

 o addMember(Object)
Adds an object to the collection.
 o hasMember(Object)
Returns true if the provided object is a member of the collection.
 o isAppropriate(Object)
Returns true if the provided object is an appropriate candidate for membership in a collection.
 o isEmpty()
Returns true if the collection contains no members, or false if it has one or more members.
 o members()
Returns an enumeration to iterate over the current members of a collection.
 o removeMember(Object)
If the object is a member of the collection it is removed.
 o size()
Returns the number of members in the collection, ie.

Methods

 o addMember
 public abstract boolean addMember(Object member) throws QTException
Adds an object to the collection. Returns true if the object is appropriate member of the collection (and thus added) and false if not.

Parameters:
member - the object that should be added as a member to the collection
Returns:
a boolean.
 o hasMember
 public abstract boolean hasMember(Object member)
Returns true if the provided object is a member of the collection.

Parameters:
member - the object to test for membership
Returns:
a boolean
 o isAppropriate
 public abstract boolean isAppropriate(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.

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
 o isEmpty
 public abstract boolean isEmpty()
Returns true if the collection contains no members, or false if it has one or more members.

Returns:
a boolean
 o members
 public abstract Enumeration members()
Returns an enumeration to iterate over the current members of a collection.

Returns:
an enumeration
 o removeMember
 public abstract void removeMember(Object member) throws QTException
If the object is a member of the collection it is removed.

Parameters:
member - the object to remove from the collection
 o size
 public abstract int size()
Returns the number of members in the collection, ie. the collection's size.

Returns:
the size of the collection.

All Packages  Class Hierarchy  This Package  Previous  Next  Index