|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object chrriis.common.ObjectRegistry
public class ObjectRegistry
A convenient class to register objects to an ID.
Constructor Summary | |
---|---|
ObjectRegistry()
Construct an object registry. |
Method Summary | |
---|---|
int |
add(Object o)
Add an object to the registry. |
void |
add(Object o,
int instanceID)
Add an object to the registry, specifying its ID, wich throws an exception if the ID is already in use. |
Object |
get(int instanceID)
Get an object using its ID. |
static ObjectRegistry |
getInstance()
Get the default shared instance of a registry. |
int[] |
getInstanceIDs()
Get all the instance IDs that are used in this registry. |
void |
remove(int instanceID)
Remove an object from the registry using its instance ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectRegistry()
Method Detail |
---|
public int add(Object o)
o
- the object to add.
public void add(Object o, int instanceID)
o
- the object to add.instanceID
- the ID to associate the object to.public Object get(int instanceID)
public void remove(int instanceID)
instanceID
- the ID of the object to remove.public int[] getInstanceIDs()
public static ObjectRegistry getInstance()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |