AbstractEnum

This is the common base class of all enumeration types.

Constructors

this
this(string name, int ordinal)

Sole constructor. Programmers cannot invoke this constructor. It is for use by code emitted by the compiler in response to enum type declarations.

Members

Functions

name
string name()

Returns the name of this enum constant, exactly as declared in its enum declaration.

opCmp
int opCmp(E o)

Compares this enum with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

opEquals
bool opEquals(Object other)

Returns true if the specified object is equal to this enum constant.

ordinal
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).

toString
string toString()

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum type should override this method when a more "programmer-friendly" string form exists.

Variables

_name
string _name;

The name of this enum constant, as declared in the enum declaration. Most programmers should use the {@link #toString} method rather than accessing this field.

_ordinal
int _ordinal;

The ordinal of this enumeration constant (its position in the enum declaration, where the initial constant is assigned an ordinal of zero).

Meta