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 Object implements Entities.EntityMap
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final int
     
    protected String[]
     
    protected int
     
    protected int[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new instance of ArrayEntityMap.
    ArrayEntityMap(int growBy)
    Constructs a new instance of ArrayEntityMap specifying the size by which the array should grow.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(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.
    name(int value)
    Returns the name of the entity identified by the specified value.
    int
    value(String name)
    Returns the value of the entity identified by the specified name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • growBy

      protected final int growBy
    • size

      protected int size
    • names

      protected String[] names
    • values

      protected int[] values
  • Constructor Details

    • ArrayEntityMap

      public ArrayEntityMap()
      Constructs a new instance of ArrayEntityMap.
    • ArrayEntityMap

      public ArrayEntityMap(int growBy)
      Constructs a new instance of ArrayEntityMap specifying the size by which the array should grow.
      Parameters:
      growBy - array will be initialized to and will grow by this amount
  • Method Details

    • add

      public void add(String name, int value)

      Add an entry to this entity map.

      Specified by:
      add in interface Entities.EntityMap
      Parameters:
      name - the entity name
      value - 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 String name(int value)

      Returns the name of the entity identified by the specified value.

      Specified by:
      name in interface Entities.EntityMap
      Parameters:
      value - the value to locate
      Returns:
      entity name associated with the specified value
    • value

      public int value(String name)

      Returns the value of the entity identified by the specified name.

      Specified by:
      value in interface Entities.EntityMap
      Parameters:
      name - the name to locate
      Returns:
      entity value associated with the specified name