Partager via


Enum.Ordinal Method

Definition

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

[Android.Runtime.Register("ordinal", "()I", "")]
public int Ordinal ();
[<Android.Runtime.Register("ordinal", "()I", "")>]
member this.Ordinal : unit -> int

Returns

the ordinal of this enumeration constant

Attributes

Remarks

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

Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures, such as java.util.EnumSet and java.util.EnumMap.

Java documentation for java.lang.Enum.ordinal().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to