NextApp Echo3
v3.0.b4

nextapp.echo.app.util
Class ConstantMap

java.lang.Object
  extended by nextapp.echo.app.util.ConstantMap

public class ConstantMap
extends java.lang.Object

Mapping between constant names and integer constant values and vice-versa (values can be queried by name, and names queried by value).


Constructor Summary
ConstantMap()
           
 
Method Summary
 void add(int constantValue, java.lang.String constantName)
          Adds a constant to the map
 java.lang.String get(int constantValue)
          Returns a constant name for a given constant value, if available.
 int get(java.lang.String constantName, int defaultValue)
          Returns a constant value for a given constant name, if available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantMap

public ConstantMap()
Method Detail

add

public void add(int constantValue,
                java.lang.String constantName)
Adds a constant to the map

Parameters:
constantValue - the value of the constant
constantName - the name of the constant

get

public java.lang.String get(int constantValue)
Returns a constant name for a given constant value, if available.

Parameters:
constantValue - the constant value
Returns:
the constant name

get

public int get(java.lang.String constantName,
               int defaultValue)
Returns a constant value for a given constant name, if available.

Parameters:
constantName - the constant name
defaultValue - the default value to return if a value is not found
Returns:
the constant value

NextApp Echo3
v3.0.b4