| Constructor and Description |
|---|
HashMapRegistry()
Create a hashmap-based registry
|
HashMapRegistry(int initId)
Create a hashmap-based registry
|
| Modifier and Type | Method and Description |
|---|---|
T |
get(int id)
Retrieve an object from the registry.
|
int |
getNewId()
Get a new unused ID.
|
boolean |
isIdExist(int id)
Whether or not an object is in the registry.
|
int |
register(T obj)
Register an object.
|
void |
set(int id,
T obj)
Associate an object to a given ID.
|
void |
setNull(int id)
Remove the object associated with a given ID from the registry.
|
public HashMapRegistry()
public HashMapRegistry(int initId)
initId - the initial IDpublic boolean isIdExist(int id)
Registrypublic T get(int id)
Registrypublic int getNewId()
Registrypublic void set(int id,
T obj)
RegistryCopyright © 2013. All rights reserved.