E
- The enum type subclasspublic abstract class Enum<E extends Enum<E>> extends Object implements Comparable<E>, Serializable
Note that when using an enumeration type as the type of a set or as the type of the keys in a map, specialized and efficient set and map implementations are available.
Class.getEnumConstants()
,
EnumSet
,
EnumMap
,
Serialized FormModifier | Constructor | Description |
---|---|---|
protected |
Enum(String name,
int ordinal) |
Sole constructor.
|
Modifier and Type | Method | Description |
---|---|---|
protected Object |
clone() |
Throws CloneNotSupportedException.
|
int |
compareTo(E o) |
Compares this enum with the specified object for order.
|
boolean |
equals(Object other) |
Returns true if the specified object is equal to this
enum constant.
|
protected void |
finalize() |
enum classes cannot have finalize methods.
|
Class<E> |
getDeclaringClass() |
Returns the Class object corresponding to this enum constant's
enum type.
|
int |
hashCode() |
Returns a hash code for this enum constant.
|
String |
name() |
Returns the name of this enum constant, exactly as declared in its
enum declaration.
|
int |
ordinal() |
Returns the ordinal of this enumeration constant (its position
in its enum declaration, where the initial constant is assigned
an ordinal of zero).
|
String |
toString() |
Returns the name of this enum constant, as contained in the
declaration.
|
static <T extends Enum<T>> |
valueOf( |