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
static class Entities.ArrayEntityMap extends java.lang.Object implements Entities.EntityMap
-
-
Constructor Summary
Constructors Constructor Description ArrayEntityMap()
Constructs a new instance ofArrayEntityMap
.ArrayEntityMap(int growBy)
Constructs a new instance ofArrayEntityMap
specifying the size by which the array should grow.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
ArrayEntityMap
public ArrayEntityMap()
Constructs a new instance ofArrayEntityMap
.
-
ArrayEntityMap
public ArrayEntityMap(int growBy)
Constructs a new instance ofArrayEntityMap
specifying the size by which the array should grow.- Parameters:
growBy
- array will be initialized to and will grow by this amount
-
-
Method Detail
-
add
public void add(java.lang.String name, int value)
Add an entry to this entity map.
- Specified by:
add
in 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
public java.lang.String name(int value)
Returns the name of the entity identified by the specified value.
- Specified by:
name
in interfaceEntities.EntityMap
- Parameters:
value
- the value to locate- Returns:
- entity name associated with the specified value
-
value
public int value(java.lang.String name)
Returns the value of the entity identified by the specified name.
- Specified by:
value
in interfaceEntities.EntityMap
- Parameters:
name
- the name to locate- Returns:
- entity value associated with the specified name
-
-