|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxsmart.ic.lang.Enum
public abstract class Enum
This class provides infrastructure needed to implement a generic value to name mapping (i.e. an Enum).
| Field Summary | |
|---|---|
protected static java.util.Map |
enumMap
The enum map. |
protected java.lang.Object |
value
|
| Constructor Summary | |
|---|---|
protected |
Enum(EnumEntry enumEntry)
Construct an Enum based on an EnumEntry. |
|
Enum(java.lang.Object value)
Constructs a Enum based on a value. |
|
Enum(java.lang.String name)
Constructs a Enum based on a name. |
| Method Summary | |
|---|---|
protected static com.foxsmart.ic.lang.Enum.Entry |
createEntry()
Returns a newly created Entry. |
boolean |
equals(java.lang.Object enumObject)
Determines if two enums are equal. |
EnumEntry |
getEntry()
Returns the entry for the value. |
static EnumEntry |
getEntry(java.lang.Class enumClass,
java.lang.Object value)
Returns the entry for the value. |
static EnumEntry |
getEntry(java.lang.Class enumClass,
java.lang.String name)
Returns the entry for the name. |
protected java.lang.Class |
getEnumClass()
Retrieves the Class of this Enum. |
java.lang.String |
getLongDescription()
Gets the long description. |
protected static java.lang.String |
getLongDescription(EnumEntry entry)
Gets the long description. |
static java.lang.Comparable |
getMaxValue()
Returns null to indicate there is no maximum value. |
static java.lang.Comparable |
getMinValue()
Returns null to indicate there is no minimum value. |
java.lang.String |
getName()
Gets the name. |
static java.lang.String |
getName(java.lang.Class enumClass,
java.lang.Object value)
Gets the name based on a value. |
protected static java.lang.String |
getName(EnumEntry entry)
Gets the name. |
java.lang.String |
getShortDescription()
Gets the short description. |
protected static java.lang.String |
getShortDescription(EnumEntry entry)
Gets the short description. |
java.lang.Object |
getValue()
Gets the value. |
static java.lang.Object |
getValue(java.lang.Class enumClass,
java.lang.String name)
Gets the value based on a name. |
protected static java.lang.Object |
getValue(EnumEntry entry)
Gets the value based on a name. |
boolean |
hasEntry()
Returns whether a name exists for the value. |
int |
hashCode()
Returns the hash code for this enum. |
java.lang.String |
toString()
Generates a string representation of this object. |
java.lang.String |
toString(EnumEntry entry)
Generates a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object value
protected static java.util.Map enumMap
| Constructor Detail |
|---|
protected Enum(EnumEntry enumEntry)
enumEntry - The entry entry to add.
public Enum(java.lang.String name)
throws java.lang.IllegalArgumentException
name - The name
java.lang.IllegalArgumentException - if the name is invalid.
public Enum(java.lang.Object value)
throws java.lang.IllegalArgumentException
value - The value
java.lang.IllegalArgumentException - if the value is out of range.| Method Detail |
|---|
protected java.lang.Class getEnumClass()
Class of the enum.protected static com.foxsmart.ic.lang.Enum.Entry createEntry()
public static java.lang.Comparable getMinValue()
public static java.lang.Comparable getMaxValue()
protected static java.lang.Object getValue(EnumEntry entry)
entry - The enum entry.
protected static java.lang.String getName(EnumEntry entry)
entry - The enum entry
protected static java.lang.String getShortDescription(EnumEntry entry)
entry - The enum entry
protected static java.lang.String getLongDescription(EnumEntry entry)
entry - The enum entry
public EnumEntry getEntry()
public boolean hasEntry()
public boolean equals(java.lang.Object enumObject)
equals in class java.lang.ObjectenumObject - The enum to compare.
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(EnumEntry entry)
entry - The enum entry
public static EnumEntry getEntry(java.lang.Class enumClass,
java.lang.String name)
enumClass - the class of the enum to usename - The name to get an entry for
public static EnumEntry getEntry(java.lang.Class enumClass,
java.lang.Object value)
enumClass - the class of the enum to usevalue - The value to get an entry for
public java.lang.Object getValue()
public java.lang.String getName()
public java.lang.String getShortDescription()
public java.lang.String getLongDescription()
public static java.lang.Object getValue(java.lang.Class enumClass,
java.lang.String name)
enumClass - the class of the enum to usename - The name to lookup.
public static java.lang.String getName(java.lang.Class enumClass,
java.lang.Object value)
enumClass - the class of the enum to usevalue - The value to lookup.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||