|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
DynamicCollection
Method Summary | |
boolean |
addMember(java.lang.Object member)
Adds an object to the collection. |
boolean |
hasMember(java.lang.Object member)
Returns true if the provided object is a member of the collection. |
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 enumeration to iterate over the current members of a collection. |
void |
removeMember(java.lang.Object member)
If the object is a member of the collection it is removed. |
int |
size()
Returns the number of members in the collection, ie. |
Method Detail |
public boolean addMember(java.lang.Object member) throws QTException
member
- the object that should be added as a member to the collectionpublic boolean hasMember(java.lang.Object member)
member
- the object to test for membershippublic boolean isAppropriate(java.lang.Object object)
object
- the object to testDynamicCollection
,
Protocol
public boolean isEmpty()
public java.util.Enumeration members()
public void removeMember(java.lang.Object member) throws QTException
member
- the object to remove from the collectionpublic int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |