com.virtuosotechnologies.lib.container
Interface ModifiableObjectSet

All Superinterfaces:
ObjectContainer, ObjectSet
All Known Implementing Classes:
BasicModifiableObjectSet

public interface ModifiableObjectSet
extends ObjectSet

An ObjectSet with mutation methods. Most applications can use the BasicModifiableObjectSet implementation.

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
 boolean addObject(Object obj)
          Add an object to the set.
 boolean removeObject(Object obj)
          Remove an object from the set
 
Methods inherited from interface com.virtuosotechnologies.lib.container.ObjectSet
addObjectSetListener, contains, removeObjectSetListener
 
Methods inherited from interface com.virtuosotechnologies.lib.container.ObjectContainer
getConstraints, getContentsAsArray, getSize
 

Method Detail

addObject

public boolean addObject(Object obj)
Add an object to the set.

Parameters:
obj - object to add
Returns:
true if the object was added, or false if the set already contained the object
Throws:
ConstraintsMismatchException - obj doesn't obey the constraints

removeObject

public boolean removeObject(Object obj)
Remove an object from the set

Parameters:
obj - object to remove
Returns:
true if the object was removed, or false if the set didn't contain the object