|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.virtuosotechnologies.lib.container.PseudoModifiableObjectSet
An ObjectSet that implements methods of ModifiableObjectSet without implementing the ModifiableObjectSet interface. This is useful for implementations that don't want to export objects that appear to be modifiable.
This implementation is fully synchronized and thread-safe. However, note that it may be used in larger implementations that are not thread-safe.
Constructor Summary | |
PseudoModifiableObjectSet()
Constructor with no constraints. |
|
PseudoModifiableObjectSet(ConstrainedKey constraints)
Constructor |
Method Summary | |
boolean |
addObject(Object obj)
Add an object to the set |
void |
addObjectSetListener(ObjectSetListener listener)
Add an ObjectSetListener. |
boolean |
contains(Object obj)
Ask whether an object is present in the set. |
ConstrainedKey |
getConstraints()
Get the constraints for the container contents. |
Object[] |
getContentsAsArray(Class cls)
Atomically get the current contents of the container as an array. |
int |
getSize()
Get the size of the container. |
boolean |
removeObject(Object obj)
Remove an object from the set |
void |
removeObjectSetListener(ObjectSetListener listener)
Remove an ObjectSetListener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PseudoModifiableObjectSet()
public PseudoModifiableObjectSet(ConstrainedKey constraints)
constraints
- constraints for the set, or null for no constraints.Method Detail |
public final ConstrainedKey getConstraints()
getConstraints
in interface ObjectContainer
public int getSize()
getSize
in interface ObjectContainer
public Object[] getContentsAsArray(Class cls)
getContentsAsArray
in interface ObjectContainer
cls
- a class representing the element type
public boolean contains(Object obj)
contains
in interface ObjectSet
obj
- object to test
public final void addObjectSetListener(ObjectSetListener listener)
addObjectSetListener
in interface ObjectSet
listener
- new listenerpublic final void removeObjectSetListener(ObjectSetListener listener)
removeObjectSetListener
in interface ObjectSet
listener
- listener to removepublic boolean addObject(Object obj)
obj
- object to add
public boolean removeObject(Object obj)
obj
- object to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |