Interface ObjectSet

All Superinterfaces:
All Known Subinterfaces:
ModifiableObjectSet, RequestableObjectSet
All Known Implementing Classes:
BasicModifiableObjectSet, PseudoModifiableObjectSet

public interface ObjectSet
extends ObjectContainer

A scaled-down set interface with listeners. This is basically a java.util.Set with several additional features: constraints on values, and listeners on state changes. Many applications will use the ModifiableObjectSet subinterface, which adds mutation methods.

This interface itself does not specify thread-safety semantics. The particular implementation or use in a larger interface should specify this. For example, standalone ObjectSets may be fully synchronized and thread-safe. ObjectSets related to AWT or Swing objects may require that all interaction be done on the AWT event thread.

Method Summary
 void addObjectSetListener(ObjectSetListener listener)
          Add an ObjectSetListener.
 boolean contains(Object obj)
          Ask whether an object is present in the set.
 void removeObjectSetListener(ObjectSetListener listener)
          Remove an ObjectSetListener.
Methods inherited from interface com.virtuosotechnologies.lib.container.ObjectContainer
getConstraints, getContentsAsArray, getSize

Method Detail


public boolean contains(Object obj)
Ask whether an object is present in the set.

obj - object to test
true if the set contains this object


public void addObjectSetListener(ObjectSetListener listener)
Add an ObjectSetListener. Listeners should be added via weak references.

listener - new listener


public void removeObjectSetListener(ObjectSetListener listener)
Remove an ObjectSetListener. Does nothing if the listener is not already present.

listener - listener to remove