static class Entities.BinaryEntityMap extends Entities.ArrayEntityMap
growBy, names, size, values
Constructor and Description |
---|
BinaryEntityMap()
Constructs a new instance of
BinaryEntityMap . |
BinaryEntityMap(int growBy)
Constructs a new instance of
ArrayEntityMap specifying the size by which the underlying array
should grow. |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String name,
int value)
Add an entry to this entity map.
|
private int |
binarySearch(int key)
Performs a binary search of the entity array for the specified key.
|
java.lang.String |
name(int value)
Returns the name of the entity identified by the specified value.
|
ensureCapacity, value
public BinaryEntityMap()
BinaryEntityMap
.public BinaryEntityMap(int growBy)
ArrayEntityMap
specifying the size by which the underlying array
should grow.growBy
- array will be initialized to and will grow by this amountprivate int binarySearch(int key)
Arrays
.key
- the key to be foundpublic void add(java.lang.String name, int value)
Add an entry to this entity map.
add
in interface Entities.EntityMap
add
in class Entities.ArrayEntityMap
name
- the entity namevalue
- the entity valuepublic java.lang.String name(int value)
Returns the name of the entity identified by the specified value.
name
in interface Entities.EntityMap
name
in class Entities.ArrayEntityMap
value
- the value to locate