com.bristle.javalib.ui
Class DisplayDataTypeEnum

java.lang.Object
  extended by com.bristle.javalib.ui.DisplayDataTypeEnum
All Implemented Interfaces:
Serializable, Comparable

public class DisplayDataTypeEnum
extends Object
implements Serializable, Comparable

This class encapsulates the concept of an data type for displayable data, offering an enumerated type, comparison operators, toString(), the ability to retrieve a Collection of all values, and various other utility functions.

Usage:

   - The typical scenarios for using this class are:

Assumptions:
Effects:
       - None.
Anticipated Changes:
Notes:
Implementation Notes:
Portability Issues:
Revision History:
   $Log$

See Also:
Serialized Form

Nested Class Summary
static class DisplayDataTypeEnum.NoSuchDisplayDataTypeEnumException
          Thrown when a specified value does not match any DisplayDataTypeEnum
 
Field Summary
static DisplayDataTypeEnum DATE_TIME
           
static DisplayDataTypeEnum DICT_STRING
           
static DisplayDataTypeEnum FLOAT
           
static DisplayDataTypeEnum INTEGER
           
private  String m_strDescrip
           
private  String m_strValue
           
static DisplayDataTypeEnum PASSWORD_STRING
           
private static long serialVersionUID
          This number identifies the version of the class definition, used for serialized instances.
private static Map st_mapALL_DISPLAY_DATA_TYPES
           
static DisplayDataTypeEnum STRING
           
 
Constructor Summary
private DisplayDataTypeEnum(String strValue, String strDescrip)
          Constructor (private, so no more values can be created)
 
Method Summary
 int compareTo(Object arg0)
          Compares other objects to this DisplayDataTypeEnum
static Collection getAllDisplayDataTypeEnums()
          Returns a collection of all DisplayDataTypeEnums, sorted by coded string getValue() values.
 String getDescrip()
          A unique human-readable description of the DisplayDataTypeEnum.
static DisplayDataTypeEnum getDisplayDataTypeEnum(String strValue)
          Get a DisplayDataTypeEnum based on its coded string value.
 String getValue()
          The coded string value of the DisplayDataTypeEnum.
 String toString()
          Returns a string representation of the DisplayDataTypeEnum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
This number identifies the version of the class definition, used for serialized instances. Be sure to increment it when adding/modifying instance variable definitions or making any other change to the class definition. Omitting this declaration causes a compiler warning for any class that implements java.io.Serializable.

See Also:
Constant Field Values

m_strValue

private final String m_strValue

m_strDescrip

private final String m_strDescrip

STRING

public static final DisplayDataTypeEnum STRING

PASSWORD_STRING

public static final DisplayDataTypeEnum PASSWORD_STRING

DICT_STRING

public static final DisplayDataTypeEnum DICT_STRING

INTEGER

public static final DisplayDataTypeEnum INTEGER

FLOAT

public static final DisplayDataTypeEnum FLOAT

DATE_TIME

public static final DisplayDataTypeEnum DATE_TIME

st_mapALL_DISPLAY_DATA_TYPES

private static final Map st_mapALL_DISPLAY_DATA_TYPES
Constructor Detail

DisplayDataTypeEnum

private DisplayDataTypeEnum(String strValue,
                            String strDescrip)
Constructor (private, so no more values can be created)

Parameters:
strValue - The coded string value of the DisplayDataTypeEnum
strDescrip - A unique human-readable description of the DisplayDataTypeEnum.
Method Detail

getValue

public String getValue()
The coded string value of the DisplayDataTypeEnum.


getDescrip

public String getDescrip()
A unique human-readable description of the DisplayDataTypeEnum.


getDisplayDataTypeEnum

public static DisplayDataTypeEnum getDisplayDataTypeEnum(String strValue)
                                                  throws DisplayDataTypeEnum.NoSuchDisplayDataTypeEnumException
Get a DisplayDataTypeEnum based on its coded string value.

Parameters:
strValue - The coded string value.
Throws:
DisplayDataTypeEnum.NoSuchDisplayDataTypeEnumException - when coded string value is invalid

toString

public String toString()
Returns a string representation of the DisplayDataTypeEnum. Useful for debugging.

Overrides:
toString in class Object

getAllDisplayDataTypeEnums

public static Collection getAllDisplayDataTypeEnums()
Returns a collection of all DisplayDataTypeEnums, sorted by coded string getValue() values.


compareTo

public int compareTo(Object arg0)
Compares other objects to this DisplayDataTypeEnum

Specified by:
compareTo in interface Comparable
Parameters:
arg0 - The object to compare with.
Returns:
1 if equal, 0 otherwise.