IRegistry<java.lang.Integer,T>DoubleRegistrypublic class IndexRegistry<T> extends java.lang.Object implements IRegistry<java.lang.Integer,T>
| Modifier and Type | Field | Description |
|---|---|---|
protected boolean |
canUnregister |
|
protected com.google.common.collect.BiMap<java.lang.Integer,T> |
map |
|
protected int |
max |
|
protected java.lang.String |
name |
|
protected com.google.common.collect.BiMap<java.lang.Integer,T> |
unmodifiableMap |
| Constructor | Description |
|---|---|
IndexRegistry(java.lang.String name,
int max,
boolean canUnregister) |
| Modifier and Type | Method | Description |
|---|---|---|
T |
get(java.lang.Integer id) |
|
java.lang.Integer |
getId(T value) |
|
int |
getNextFreeId() |
|
int |
getSize() |
|
com.google.common.collect.BiMap<java.lang.Integer,T> |
getUnmodifiable() |
|
void |
register(java.lang.Integer id,
T value) |
|
java.lang.String |
toString() |
|
void |
unregister(java.lang.Integer id) |
protected final int max
protected final java.lang.String name
protected final boolean canUnregister
protected final com.google.common.collect.BiMap<java.lang.Integer,T> map
protected final com.google.common.collect.BiMap<java.lang.Integer,T> unmodifiableMap
public IndexRegistry(java.lang.String name,
int max,
boolean canUnregister)
public void register(java.lang.Integer id,
T value)
public T get(java.lang.Integer id)
public java.lang.Integer getId(T value)
public int getNextFreeId()
public void unregister(java.lang.Integer id)
unregister in interface IRegistry<java.lang.Integer,T>public com.google.common.collect.BiMap<java.lang.Integer,T> getUnmodifiable()
getUnmodifiable in interface IRegistry<java.lang.Integer,T>public java.lang.String toString()
toString in class java.lang.Object