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
-
addMember(Object)
- Adds an object to the collection.
-
hasMember(Object)
- Returns true if the provided object is a member of the collection.
-
isAppropriate(Object)
- Returns true if the provided object is an appropriate candidate for
membership in a collection.
-
isEmpty()
- Returns true if the collection contains no members, or false if
it has one or more members.
-
members()
- Returns an enumeration to iterate over the current members of a collection.
-
removeMember(Object)
- If the object is a member of the collection it is removed.
-
size()
- Returns the number of members in the collection, ie.
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.
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
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
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
members
public abstract Enumeration members()
- Returns an enumeration to iterate over the current members of a collection.
- Returns:
- an enumeration
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
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