|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.Enum
Convenient base class for enumerated types. To use this class you must extend it and make the class **final**.
Constructor Summary | |
protected |
Enum(java.lang.String name,
java.lang.String displayName,
java.lang.Integer ordinal)
Creates a new enumerated object. |
Method Summary | |
int |
compareTo(java.lang.Object o)
Compares two enums of the same enumerated type based on their ordinal. |
boolean |
equals(java.lang.Object o)
All enums should be identity comparable. |
java.lang.String |
getDisplayName()
Returns the display name of the Enum. |
static Enum |
getEnumByName(java.lang.Class clazz,
java.lang.String name)
Looks up an enumerated object for a given enumerated class. |
static java.util.List |
getEnums(java.lang.Class clazz)
Given an enumerated class, returns the enums of that class, sorted by their ordinal. |
java.lang.String |
getName()
Returns the name of the Enum. |
int |
getOrdinal()
Returns the ordinal value of the Enum. |
int |
hashCode()
All enums should be identity comparable. |
java.lang.String |
toString()
Returns the string suitable for debugging purposes. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Enum(java.lang.String name, java.lang.String displayName, java.lang.Integer ordinal)
name
- The name of the enumerated object.displayName
- The localized message tag.ordinal
- The ordinal of the enum. If null will automatically be
set to 1 plus the previous for a given Enum class.Method Detail |
public static Enum getEnumByName(java.lang.Class clazz, java.lang.String name)
public static java.util.List getEnums(java.lang.Class clazz)
public final java.lang.String getName()
public final java.lang.String getDisplayName()
public final int getOrdinal()
public java.lang.String toString()
public final boolean equals(java.lang.Object o)
public final int hashCode()
public final int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |