| java.lang.Object | |
| ↳ | java.lang.Enum<E extends java.lang.Enum<E>> |
The superclass of all enumerated types.
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructor for enum subtypes.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns the comparative ordering of the receiver and the given argument.
| |||||||||||
Returns true only if the receiver is equal to the argument.
| |||||||||||
Returns the enum constant's declaring class.
| |||||||||||
Returns the hash of the receiver.
| |||||||||||
Returns the name of the enum constant.
| |||||||||||
Returns the position of the enum constant in the declaration.
| |||||||||||
Answer a string representation of the receiver suitable for display to a
programmer.
| |||||||||||
Returns the named constant of the given enum type.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Enums are singletons, they may not be cloned.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface java.lang.Comparable
| |||||||||||
Constructor for enum subtypes.
| name | the enum constant declared name. |
|---|---|
| ordinal | the enum constant position ordinal. |
Returns 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.
Returns true only if the receiver is equal to the argument. Since enums are unique this is equivalent to an identity test.
| other | Object the object to compare with this object. |
|---|
Returns the enum constant's declaring class.
Returns the hash of the receiver.
Returns the name of the enum constant. The name is the field as it
appears in the Enum declaration.
Returns the position of the enum constant in the declaration. The first constant has and ordinal value of zero.
Answer a string representation of the receiver suitable for display to a programmer.
Returns the named constant of the given enum type.
| enumType | the class of the enumerated type to search for the constant value. |
|---|---|
| name | the name of the constant value to find. |
| NullPointerException | if either the enumType or name
are null. |
|---|---|
| IllegalArgumentException | if enumType is not an enumerated type or does
not have a constant value called name.
|
Enums are singletons, they may not be cloned. This method always throws a CloneNotSupportedException.
| CloneNotSupportedException |
|---|