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

Constructor Index

 o Protocol(Class)
Creates a Protocol from the supplied class.
 o Protocol(Class[])
Creates a Protocol from the supplied classes.

Method Index

 o addMember(Object)
Adds a class object to this Protocol.
 o defaultProtocol()
Returns an Enumeration that enables you to examine the default classes for this Protocol.
 o hasMember(Object)
Returns true if the supplied class object is a member of this Protocol.
 o isAppropriate(Object)
Returns true if this object is an instance of the Class class.
 o isEmpty()
Returns true if the Protocol has no members, otherwise false
 o members()
Returns an Enumeration to iterate over all of the members of the Protocol object.
 o passProtocol(Object)
Returns true if the object is an instance of ALL of the class object members of the Protocol.
 o removeMember(Object)
Removes a class object that was previously added to this Protocol.
 o size()
Returns the number of class objects that are in this Protocol.

Constructors

 o Protocol
 public Protocol(Class defaultProtocols[])
Creates a Protocol from the supplied classes. These default classes cannot be removed from this Protocol once created.

 o Protocol
 public Protocol(Class defaultProtocol)
Creates a Protocol from the supplied class. These default class cannot be removed from this Protocol once created.

Methods

 o defaultProtocol
 public Enumeration defaultProtocol()
Returns an Enumeration that enables you to examine the default classes for this Protocol.

Returns:
an Enumeration
 o members
 public Enumeration members()
Returns an Enumeration to iterate over all of the members of the Protocol object.

Returns:
an Enumeration
 o isEmpty
 public boolean isEmpty()
Returns true if the Protocol has no members, otherwise false

Returns:
a boolean
 o hasMember
 public boolean hasMember(Object object)
Returns true if the supplied class object is a member of this Protocol.

Returns:
a boolean
 o size
 public int size()
Returns the number of class objects that are in this Protocol.

Returns:
an int
 o 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)
 o 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.

 o 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
 o 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