| java.lang.Object java.lang.Enum
Constructor Summary | |
protected | Enum(String name, int ordinal) Constructor for enum subtypes. |
Method Summary | |
final protected Object | clone() Enums are singletons, they may not be cloned. | final public int | compareTo(E o) Answers the comparative ordering of the receiver and the given argument. | final public boolean | equals(Object other) Answers true only if the receiver is equal to the argument. | final public Class<E> | getDeclaringClass() Answers the enum constant's declaring class. | static T[] | getValues(Class<T> enumType) | final public int | hashCode() Answers the hash of the receiver. | final public String | name() Answers the name of the enum constant. | final public int | ordinal() Answers the position of the enum constant in the declaration. | public String | toString() Answer a string representation of the receiver suitable for display to a
programmer. | public static T | valueOf(Class<T> enumType, String name) Answers the named constant of the given enum type.
Parameters: enumType - the class of the enumerated type to search for the constantvalue. Parameters: name - the name of the constant value to find. |
Enum | protected Enum(String name, int ordinal)(Code) | | Constructor for enum subtypes.
Parameters: name - the enum constant declared name. Parameters: ordinal - the enum constant position ordinal. |
compareTo | final public int compareTo(E o)(Code) | | Answers the comparative ordering of the receiver and the given argument.
If the receiver is naturally ordered before the actual argument then the
result is negative, if the receiver is naturally ordered in equal
position to the actual argument then the result is zero, and if the
receiver is naturally ordered after the actual argument then the result
is positive.
negative, zero, or positive value depending upon before, equal,or after natural order respectively. See Also: Comparable.compareTo(Object) |
equals | final public boolean equals(Object other)(Code) | | Answers true only if the receiver is equal to the argument. Since enums
are unique this is equivalent to an identity test.
true if the receiver and argument are equal, otherwise returnfalse. |
getDeclaringClass | final public Class<E> getDeclaringClass()(Code) | | Answers the enum constant's declaring class.
the class object representing the constant's enum type. |
hashCode | final public int hashCode()(Code) | | Answers the hash of the receiver.
the hash code. |
name | final public String name()(Code) | | Answers the name of the enum constant. The name is the field as it
appears in the Enum declaration.
the precise enum constant name. See Also: Enum.toString() |
ordinal | final public int ordinal()(Code) | | Answers the position of the enum constant in the declaration. The first
constant has and ordinal value of zero.
the constant's ordinal value. |
toString | public String toString()(Code) | | Answer a string representation of the receiver suitable for display to a
programmer.
the displayable string name. |
valueOf | public static T valueOf(Class<T> enumType, String name)(Code) | | Answers the named constant of the given enum type.
Parameters: enumType - the class of the enumerated type to search for the constantvalue. Parameters: name - the name of the constant value to find. the enum constant throws: NullPointerException - if either the enumType or name are null . throws: IllegalArgumentException - if enumType is not an enumerated type or doesnot have a constant value called name . |
|
|