| Constructor and Description |
|---|
WeakRefRegistry()
Create a weak reference registry.
|
WeakRefRegistry(int initId)
Create a weak reference 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 WeakRefRegistry()
public WeakRefRegistry(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.