public class RegistryNamespaced<K,V> extends RegistrySimple<K,V> implements IObjectIntIterable<V>
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<V,K> |
inverseObjectRegistry
A BiMap of objects (key) to their names (value).
|
protected IntIdentityHashBiMap<V> |
underlyingIntegerMap
The backing store that maps Integers to objects.
|
registryObjects
Constructor and Description |
---|
RegistryNamespaced() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(K key)
Does this registry contain an entry for the given key?
|
protected java.util.Map<K,V> |
createUnderlyingMap()
Creates the Map we will use to map keys to their registered values.
|
int |
getIDForObject(V value)
Gets the integer ID we use to identify the given object.
|
K |
getNameForObject(V value)
Gets the name we use to identify the given object.
|
V |
getObject(K name) |
V |
getObjectById(int id)
Gets the object identified by the given ID.
|
java.util.Iterator<V> |
iterator() |
void |
register(int id,
K key,
V value) |
getKeys, getRandomObject, putObject
protected final IntIdentityHashBiMap<V> underlyingIntegerMap
protected java.util.Map<K,V> createUnderlyingMap()
createUnderlyingMap
in class RegistrySimple<K,V>
public K getNameForObject(V value)
public boolean containsKey(K key)
containsKey
in class RegistrySimple<K,V>
public int getIDForObject(V value)
public V getObjectById(int id)