public abstract class Enum extends Object
implements Comparable<E extends Enum<E>> Serializable
Known Direct Subclasses

This is the common base class of all Java language enumeration types. More information about enums, including descriptions of the implicitly declared methods synthesized by the compiler, can be found in section 8.9 of The Java™ Language Specification.

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 {@linkplain java.util.EnumSet set} and {@linkplain java.util.EnumMap map} implementations are available.

Protected Constructor Summary

Enum(String name, int ordinal)
Sole constructor.

Public Method Summary

final int
compareTo(E o)
Compares this enum with the specified object for order.
final boolean
equals(Object other)
Returns true if the specified object is equal to this enum constant.
final Class<E>
Returns the Class object corresponding to this enum constant's enum type.
final int
Returns a hash code for this enum constant.
final String
Returns the name of this enum constant, exactly as declared in its enum declaration.
final int
Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).
Returns the name of this enum constant, as contained in the declaration.
static <T extends Enum<T>> T
valueOf(Class<T> enumType, String name)
Returns the enum constant of the specified enum type with the specified name.

Protected Method Summary

final Object
Throws CloneNotSupportedException.
final void
enum classes cannot have finalize methods.

Inherited Method Summary