All Packages Class Hierarchy This Package Previous Next Index
Class quicktime.app.spaces.Protocol
java.lang.Object
|
+----quicktime.app.spaces.Protocol
- public class Protocol
- extends Object
- implements Collection
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.
- See Also:
- DynamicCollection
-
Protocol(Class)
- Creates a Protocol from the supplied class.
-
Protocol(Class[])
- Creates a Protocol from the supplied classes.
-
addMember(Object)
- Adds a class object to this Protocol.
-
defaultProtocol()
- Returns an Enumeration that enables you to examine the default classes for
this Protocol.
-
hasMember(Object)
- Returns true if the supplied class object is a member of this Protocol.
-
isAppropriate(Object)
- Returns true if this object is an instance of the Class class.
-
isEmpty()
- Returns true if the Protocol has no members, otherwise false
-
members()
- Returns an Enumeration to iterate over all of the members of the Protocol object.
-
passProtocol(Object)
- Returns true if the object is an instance of ALL of the class object members of the Protocol.
-
removeMember(Object)
- Removes a class object that was previously added to this Protocol.
-
size()
- Returns the number of class objects that are in this Protocol.
Protocol
public Protocol(Class defaultProtocols[])
- Creates a Protocol from the supplied classes. These default classes cannot be
removed from this Protocol once created.
Protocol
public Protocol(Class defaultProtocol)
- Creates a Protocol from the supplied class. These default class cannot be
removed from this Protocol once created.
defaultProtocol
public Enumeration defaultProtocol()
- Returns an Enumeration that enables you to examine the default classes for
this Protocol.
- Returns:
- an Enumeration
members
public Enumeration members()
- Returns an Enumeration to iterate over all of the members of the Protocol object.
- Returns:
- an Enumeration
isEmpty
public boolean isEmpty()
- Returns true if the Protocol has no members, otherwise false
- Returns:
- a boolean
hasMember
public boolean hasMember(Object object)
- Returns true if the supplied class object is a member of this Protocol.
- Returns:
- a boolean
size
public int size()
- Returns the number of class objects that are in this Protocol.
- Returns:
- an int
addMember
public boolean addMember(Object member)
- Adds a class object to this Protocol. The application can later remove any class objects
that are added to a Protocol in this manner
- Returns:
- true if the class object was successfully added (or is already a member)
removeMember
public void removeMember(Object member)
- Removes a class object that was previously added to this Protocol. The application cannot
remove class objects that are part of the default protocol of this Protocol.
isAppropriate
public boolean isAppropriate(Object object)
- Returns true if this object is an instance of the Class class.
- Parameters:
- object - the object to test
- Returns:
- a boolean
passProtocol
public boolean passProtocol(Object object)
- Returns true if the object is an instance of ALL of the class object members of the Protocol.
If the object is not an instance of any one of the member class objects the method returns false.
- Parameters:
- object - the Object to test
- Returns:
- a boolean
All Packages Class Hierarchy This Package Previous Next Index