Package org.apache.commons.lang
Class Entities.ArrayEntityMap
java.lang.Object
org.apache.commons.lang.Entities.ArrayEntityMap
- All Implemented Interfaces:
Entities.EntityMap
- Direct Known Subclasses:
Entities.BinaryEntityMap
- Enclosing class:
- Entities
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance ofArrayEntityMap.ArrayEntityMap(int growBy) Constructs a new instance ofArrayEntityMapspecifying the size by which the array should grow. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an entry to this entity map.protected voidensureCapacity(int capacity) Verifies the capacity of the entity array, adjusting the size if necessary.name(int value) Returns the name of the entity identified by the specified value.intReturns the value of the entity identified by the specified name.
-
Field Details
-
growBy
protected final int growBy -
size
protected int size -
names
-
values
protected int[] values
-
-
Constructor Details
-
ArrayEntityMap
public ArrayEntityMap()Constructs a new instance ofArrayEntityMap. -
ArrayEntityMap
public ArrayEntityMap(int growBy) Constructs a new instance ofArrayEntityMapspecifying the size by which the array should grow.- Parameters:
growBy- array will be initialized to and will grow by this amount
-
-
Method Details
-
add
Add an entry to this entity map.
- Specified by:
addin interfaceEntities.EntityMap- Parameters:
name- the entity namevalue- the entity value
-
ensureCapacity
protected void ensureCapacity(int capacity) Verifies the capacity of the entity array, adjusting the size if necessary.- Parameters:
capacity- size the array should be
-
name
Returns the name of the entity identified by the specified value.
- Specified by:
namein interfaceEntities.EntityMap- Parameters:
value- the value to locate- Returns:
- entity name associated with the specified value
-
value
Returns the value of the entity identified by the specified name.
- Specified by:
valuein interfaceEntities.EntityMap- Parameters:
name- the name to locate- Returns:
- entity value associated with the specified name
-