| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
IndexRegistry(java.lang.String name,
int max) |
| Modifier and Type | Method and 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() |
protected final int max
protected final java.lang.String name
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 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 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