Class Entities.BinaryEntityMap

java.lang.Object
org.apache.commons.lang.Entities.ArrayEntityMap
org.apache.commons.lang.Entities.BinaryEntityMap
All Implemented Interfaces:
Entities.EntityMap
Enclosing class:
Entities

static class Entities.BinaryEntityMap extends Entities.ArrayEntityMap
  • Constructor Details

    • BinaryEntityMap

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

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

    • binarySearch

      private int binarySearch(int key)
      Performs a binary search of the entity array for the specified key. This method is based on code in Arrays.
      Parameters:
      key - the key to be found
      Returns:
      the index of the entity array matching the specified key
    • add

      public void add(String name, int value)

      Add an entry to this entity map.

      Specified by:
      add in interface Entities.EntityMap
      Overrides:
      add in class Entities.ArrayEntityMap
      Parameters:
      name - the entity name
      value - the entity value
    • name

      public String name(int value)

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

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