static class Entities.ArrayEntityMap extends java.lang.Object implements Entities.EntityMap
| Modifier and Type | Field and Description |
|---|---|
protected int |
growBy |
protected java.lang.String[] |
names |
protected int |
size |
protected int[] |
values |
| Constructor and Description |
|---|
ArrayEntityMap()
Constructs a new instance of
ArrayEntityMap. |
ArrayEntityMap(int growBy)
Constructs a new instance of
ArrayEntityMap specifying the size by which the array should
grow. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String name,
int value)
Add an entry to this entity map.
|
protected void |
ensureCapacity(int capacity)
Verifies the capacity of the entity array, adjusting the size if necessary.
|
java.lang.String |
name(int value)
Returns the name of the entity identified by the specified value.
|
int |
value(java.lang.String name)
Returns the value of the entity identified by the specified name.
|
protected final int growBy
protected int size
protected java.lang.String[] names
protected int[] values
public ArrayEntityMap()
ArrayEntityMap.public ArrayEntityMap(int growBy)
ArrayEntityMap specifying the size by which the array should
grow.growBy - array will be initialized to and will grow by this amountpublic void add(java.lang.String name,
int value)
Add an entry to this entity map.
add in interface Entities.EntityMapname - the entity namevalue - the entity valueprotected void ensureCapacity(int capacity)
capacity - size the array should bepublic java.lang.String name(int value)
Returns the name of the entity identified by the specified value.
name in interface Entities.EntityMapvalue - the value to locatepublic int value(java.lang.String name)
Returns the value of the entity identified by the specified name.
value in interface Entities.EntityMapname - the name to locate