org.vizzini.util
Class DefaultEnumeratedType

java.lang.Object
  extended by org.vizzini.util.AbstractEnumeratedType
      extended by org.vizzini.util.DefaultEnumeratedType
All Implemented Interfaces:
Comparable, IEnumeratedType

public class DefaultEnumeratedType
extends AbstractEnumeratedType

Provides a default implementation of an enumerated type.

Since:
v0.1
Version:
v0.2
Author:
Jeffrey M. Thompson

Constructor Summary
DefaultEnumeratedType(String name)
          Construct this object.
 
Method Summary
static DefaultEnumeratedType get(int i)
          Get the type which corresponds to the given integer.
static int getSize()
          Return the number of enumerated values.
static DefaultEnumeratedType valueOf(String name)
          Get the type which corresponds to the given string.
 
Methods inherited from class org.vizzini.util.AbstractEnumeratedType
compareTo, equals, getDisplayName, getName, hashCode, intValue, setOrdinal, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultEnumeratedType

public DefaultEnumeratedType(String name)
Construct this object. By making the constructor public, new ordinals can be added at any time.

Parameters:
name - Enumeration name.
Since:
v0.1
Method Detail

getSize

public static final int getSize()
Return the number of enumerated values.

Since:
v0.1

get

public static DefaultEnumeratedType get(int i)
Get the type which corresponds to the given integer.

Parameters:
i - Enumeration index.
Since:
v0.1

valueOf

public static DefaultEnumeratedType valueOf(String name)
Get the type which corresponds to the given string.

Parameters:
name - Enumeration name.
Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02