org.eigenbase.util
Class EnumeratedValues

java.lang.Object
  extended by org.eigenbase.util14.Enum14
      extended by org.eigenbase.util.EnumeratedValues
All Implemented Interfaces:
Cloneable

public class EnumeratedValues
extends Enum14

EnumeratedValues is a helper class for declaring a set of symbolic constants which have names, ordinals, and possibly descriptions. The ordinals do not have to be contiguous.

Typically, for a particular set of constants, you derive a class from this interface, and declare the constants as public static final members. Give it a private constructor, and a public static final ClassName instance member to hold the singleton instance.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eigenbase.util14.Enum14
Enum14.BasicValue, Enum14.SerializableValue, Enum14.Value
 
Constructor Summary
EnumeratedValues()
          Creates a new empty, mutable enumeration.
EnumeratedValues(Enum14.Value[] values)
          Creates an enumeration, with an array of values, and freezes it.
EnumeratedValues(String[] names)
          Creates an enumeration, initialize it with an array of strings, and freezes it.
EnumeratedValues(String[] names, int[] codes)
          Create an enumeration, initializes it with arrays of code/name pairs, and freezes it.
EnumeratedValues(String[] names, int[] codes, String[] descriptions)
          Create an enumeration, initializes it with arrays of code/name pairs, and freezes it.
 
Method Summary
 EnumeratedValues getMutableClone()
          Creates a mutable enumeration from an existing enumeration, which may already be immutable.
 
Methods inherited from class org.eigenbase.util14.Enum14
badValue, clone, containsName, getDescription, getMax, getMin, getMutableClone14, getName, getNames, getOrdinal, getSize, getValue, getValue, isImmutable, isValid, iterator, makeImmutable, register, unexpected
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumeratedValues

public EnumeratedValues()
Creates a new empty, mutable enumeration.


EnumeratedValues

public EnumeratedValues(Enum14.Value[] values)
Creates an enumeration, with an array of values, and freezes it.


EnumeratedValues

public EnumeratedValues(String[] names)
Creates an enumeration, initialize it with an array of strings, and freezes it.


EnumeratedValues

public EnumeratedValues(String[] names,
                        int[] codes)
Create an enumeration, initializes it with arrays of code/name pairs, and freezes it.


EnumeratedValues

public EnumeratedValues(String[] names,
                        int[] codes,
                        String[] descriptions)
Create an enumeration, initializes it with arrays of code/name pairs, and freezes it.

Method Detail

getMutableClone

public EnumeratedValues getMutableClone()
Creates a mutable enumeration from an existing enumeration, which may already be immutable.