|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.spaces.Protocol
A Protocol is a collection of classes that are used to test an object against. The passProtocol (Object o) method uses the Class.instanceOf method on each of the classes in its collection. If the incoming object is not an instance of any of the classes in the Protocol then the passProtocol method returns false. If the incoming object is then it returns true.
For DynamicCollections an application can dynamically assign or add classes to a Protocol to tighten the membership requirements of its collection. When an object is added to a dynamic collection the dynamic collection will first test the object against its Protocol's passProtocol method. Only if it passes this test is the object allowed to be added to the Collection. This test is encapsulated in the DynamicCollection's isAppropriate method.
DynamicCollection
Constructor Summary | |
Protocol(java.lang.Class defaultProtocol)
Creates a Protocol from the supplied class. |
|
Protocol(java.lang.Class[] defaultProtocols)
Creates a Protocol from the supplied classes. |
Method Summary | |
boolean |
addMember(java.lang.Object member)
Adds a class object to this Protocol. |
java.util.Enumeration |
defaultProtocol()
Returns an Enumeration that enables you to examine the default classes for this Protocol. |
boolean |
hasMember(java.lang.Object object)
Returns true if the supplied class object is a member of this Protocol. |
boolean |
isAppropriate(java.lang.Object object)
Returns true if this object is an instance of the Class class. |
boolean |
isEmpty()
Returns true if the Protocol has no members, otherwise false |
java.util.Enumeration |
members()
Returns an Enumeration to iterate over all of the members of the Protocol object. |
boolean |
passProtocol(java.lang.Object object)
Returns true if the object is an instance of ALL of the class object members of the Protocol. |
void |
removeMember(java.lang.Object member)
Removes a class object that was previously added to this Protocol. |
int |
size()
Returns the number of class objects that are in this Protocol. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Protocol(java.lang.Class[] defaultProtocols)
public Protocol(java.lang.Class defaultProtocol)
Method Detail |
public java.util.Enumeration defaultProtocol()
public java.util.Enumeration members()
members
in interface Collection
public boolean isEmpty()
isEmpty
in interface Collection
public boolean hasMember(java.lang.Object object)
hasMember
in interface Collection
public int size()
size
in interface Collection
public boolean addMember(java.lang.Object member)
addMember
in interface Collection
public void removeMember(java.lang.Object member)
removeMember
in interface Collection
quicktime.app.spaces.Collection
member
- the object to remove from the collectionpublic boolean isAppropriate(java.lang.Object object)
isAppropriate
in interface Collection
object
- the object to testpublic boolean passProtocol(java.lang.Object object)
object
- the Object to test
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |