|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.glaivestone.javax.lang.ConstantType
|
+--com.glaivestone.javax.lang.EnumerationType
EnumerationType is the abstract superclass for implementing constant
types which allow clients to enumerate the defined constants in the enumeration.
Enumerated values are Comparable. The default sort order
for an enumeration is in increasing order by ordinal value.
Ordinal values for an enumeration type are generally expected to start at 0
and increment by 1 for each constant defined in the enumeration. It is the
responsibility of concrete subclasses to provide a suitable ordinal allocation
mechanism. Enumeration classes will usually provide for strict control over allocation
by using private constructors; they may be declared final
to prevent subclassing from affecting the enumeration.
Concrete subclasses are responsble for implementing the following static methods:
size() - returns the int number of values in the enumeration
iterator() - returns an Iterator on the values in the enumeration
| Field Summary |
| Fields inherited from class com.glaivestone.javax.lang.ConstantType |
name, ord |
| Method Summary | |
int |
compareTo(java.lang.Object aValue)
Compares this object with the specified object for order. |
static java.util.Iterator |
getIterator(java.lang.Class anEnumerationClass)
Answer an iterator over the enumeration constants of the specified type. |
static int |
getSize(java.lang.Class anEnumerationClass)
Answer the number of enumeration constants of the specified type. |
static java.util.List |
getValues(java.lang.Class anEnumerationClass)
Returns a list of the enumeration constants of the specified type. |
static void |
validateEnumerationType(java.lang.Class aClass)
Verify that the specified class is an enumeration type. |
| Methods inherited from class com.glaivestone.javax.lang.ConstantType |
getConstant, getConstant, intValue, toConstantName, toDescriptionString, toIdentificationString, toQualifiedConstantName, toSimpleConstantName, toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public static java.util.Iterator getIterator(java.lang.Class anEnumerationClass)
public static int getSize(java.lang.Class anEnumerationClass)
public static java.util.List getValues(java.lang.Class anEnumerationClass)
Typically ordered in ascending ordinal value.
public static void validateEnumerationType(java.lang.Class aClass)
java.lang.IllegalArgumentException - not an enumeration typepublic int compareTo(java.lang.Object aValue)
compareTo in interface java.lang.ComparableaValue - the value to be compared.
java.lang.ClassCastException - if the specified object's type prevents it
from being compared to this Object.Comparable.compareTo(java.lang.Object)
|
GFL 1.1 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||