|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.databeans.AbstractDataObject dsto.dfc.databeans.DataObject dsto.dfc.databeans.Registry
public class Registry
A registry of data objects where each object is uniquely identified by one of its properties. The properties of a registry are the key values of objects add ()'ed to it, the values are the objects themselves. This provides extra convenience over using setValue () and getValue () calls plus automatic uniqueness checking.
Note: the key property of an object should not change once added to the registry.
Field Summary | |
---|---|
Object |
keyProperty
|
Fields inherited from class dsto.dfc.databeans.DataObject |
---|
propertyToValue, typeInfo |
Fields inherited from class dsto.dfc.databeans.AbstractDataObject |
---|
listeners |
Fields inherited from interface dsto.dfc.databeans.IDataObject |
---|
OVERRIDE, PERSISTENT, PERSISTENT_OVERRIDE, TRANSIENT, TRANSIENT_OVERRIDE |
Constructor Summary | |
---|---|
Registry()
Create a default instance using the default string "id" as the key property. |
|
Registry(Object keyProperty)
Create a new instance. |
Method Summary | |
---|---|
void |
add(IDataObject object)
Add an object to the registry. |
boolean |
containsKey(Object key)
Test if a given key exists in the registry. |
IDataObject |
find(Object key)
Find an object with a given key. |
Iterator |
iterator()
Create an iterator over all the entities in the registry. |
IDataObject |
peek(Object key)
Peek to see if an object exists. |
void |
remove(Object key)
|
int |
size()
The number of objects in the registry. |
Set |
snapshot()
Create a snapshot of the current objects. |
Methods inherited from class dsto.dfc.databeans.DataObject |
---|
getTypeInfo, getValue, isTransient, propertyIterator, setTypeInfo, setValue, shallowClone |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final Object keyProperty
Constructor Detail |
---|
public Registry()
public Registry(Object keyProperty)
keyProperty
- The property that is used to identify objects
added to the registry.Method Detail |
---|
public void add(IDataObject object) throws IllegalArgumentException
object
- The object to add.
IllegalArgumentException
- if the objects' key is null or
already in use.public void remove(Object key)
public IDataObject peek(Object key)
key
- The object key.
find(Object)
public IDataObject find(Object key) throws IllegalArgumentException
key
- The object key.
IllegalArgumentException
- if no object with the key exists.peek(Object)
public boolean containsKey(Object key)
public Iterator iterator()
iterator
in class DataObject
public int size()
public Set snapshot()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |