org.jcoderz.commons.types
Class TaggedColor

java.lang.Object
  extended by org.jcoderz.commons.types.TaggedColor
All Implemented Interfaces:
Serializable, EnumType, StrongType, TestTaggerInterface

public final class TaggedColor
extends Object
implements Serializable, EnumType, TestTaggerInterface

Enumerated type of a tagged color. Instances of this class are immutable. The following tagged colors are defined:

The values of this enum have a internal sequential integer representation starting with '0'.

Author:
generated
See Also:
Serialized Form

Field Summary
static TaggedColor BLUE
          The TaggedColor blue.
static TaggedColor RED
          The TaggedColor red.
static String TYPE_NAME
          The name of this type.
static Map VALUE_MAP
          Immutable map using the name string as key holding the TaggedColors as values.
static List VALUES
          Immutable list of the TaggedColors.
static TaggedColor YELLOW
          The TaggedColor yellow.
 
Method Summary
static TaggedColor fromInt(int i)
          Creates a TaggedColor object from its int representation.
static TaggedColor fromString(String str)
          Creates a TaggedColor object from its String representation.
 int toInt()
          Returns the int representation of this tagged color.
 String toString()
          Returns the String representation of this tagged color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final String TYPE_NAME
The name of this type.

See Also:
Constant Field Values

BLUE

public static final TaggedColor BLUE
The TaggedColor blue.


RED

public static final TaggedColor RED
The TaggedColor red.


YELLOW

public static final TaggedColor YELLOW
The TaggedColor yellow.


VALUES

public static final List VALUES
Immutable list of the TaggedColors.


VALUE_MAP

public static final Map VALUE_MAP
Immutable map using the name string as key holding the TaggedColors as values.

Method Detail

fromInt

public static TaggedColor fromInt(int i)
                           throws ArgumentMalformedException
Creates a TaggedColor object from its int representation.

Parameters:
i - the integer representation of the tagged color.
Returns:
the TaggedColor object represented by this int.
Throws:
ArgumentMalformedException - If the assigned int value isn't listed in the internal tagged color table.

fromString

public static TaggedColor fromString(String str)
                              throws ArgumentMalformedException
Creates a TaggedColor object from its String representation.

Parameters:
str - the string representation of the tagged color.
Returns:
the TaggedColor object represented by this str.
Throws:
ArgumentMalformedException - If the given str value isn't listed in the internal tagged color table.

toInt

public int toInt()
Returns the int representation of this tagged color.

Specified by:
toInt in interface EnumType
Returns:
the int representation of this tagged color.

toString

public String toString()
Returns the String representation of this tagged color.

Overrides:
toString in class Object
Returns:
the String representation of this tagged color.


Copyright 2007 The jCoderZ Project.