|
qflib 0.99 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.qfs.lib.util.Enum
An implementation of the Enum pattern to provide enumerations for Java.
Constructor Summary | |
Enum(int value,
java.lang.String name)
Create a new Enum. |
Method Summary | |
java.lang.Object |
clone()
Cloning conflicts with the identity requirement, so the original Enum is returned. |
int |
compareTo(java.lang.Object o)
Compare the Enum to another enum. |
boolean |
equals(java.lang.Object o)
Compare two enums. |
java.lang.String |
getName()
Get the name of the Enum. |
java.lang.String |
getTypeName()
Get the type name for the Enum. |
int |
getValue()
Get the int value. |
int |
hashCode()
Finalize hashCode to avoid accidental overriding. |
static Enum |
lookup(java.lang.String type,
int value)
Get an Enum defined by its type and value. |
java.lang.Object |
readResolve()
Resolve an Object during derserialization. |
java.lang.String |
toString()
Get a String representation. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Enum(int value, java.lang.String name) throws java.lang.IllegalArgumentException
value
- The value for the Enum.name
- The Name for the Enum.
java.lang.IllegalArgumentException
- if an Enum of the same class with
the same id is already registered.Method Detail |
public static Enum lookup(java.lang.String type, int value)
type
- The type as returned by getTypeName.value
- The value of the enum.
public final int getValue()
public final java.lang.String getName()
public java.lang.String toString()
public java.lang.Object clone()
public java.lang.Object readResolve()
public final boolean equals(java.lang.Object o)
o
- The object to compare to.
public final int hashCode()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- The enum to compare against.
public java.lang.String getTypeName()
|
qflib 0.99 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |