Java language enumeration types have an ordinal()
method, which returns the numerical position of each enumeration constant in its class declaration.
Wiki Markup |
---|
The _Java Language Specification_ \[[JLS 2005|AA. Bibliography#JLS [805]\] [§8.9, "Enums"|http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.9] of the _Java Language Specification_ \[[JLS 2005|AA. Bibliography#JLS 05]\] does not specify the use of {{ordinal()}} in programs. However, using the {{ordinal()}} method to derive the value associated with an enum constant is error-prone and should be avoided. |
...
Wiki Markup |
---|
\[[JLS 2005|AA. Bibliography#JLS 05]\] 8§8.9, "Enums" \[[API 2006|AA. Bibliography#API 06]\] [Enum|http://download.oracle.com/javase/6/docs/api/java/lang/Enum.html] |
...