The documentation for the Enum method ordinal() states "Most programmers
will have no use for this method." Since I can't use an enum constant
directly as an array index (which seems like a huge oversight), how else
would I use it for indexing *other* than getting the ordinal?
Thanks,
Eric
Tom Hawtin - 12 May 2007 12:07 GMT
> The documentation for the Enum method ordinal() states "Most programmers
> will have no use for this method." Since I can't use an enum constant
> directly as an array index (which seems like a huge oversight), how else
> would I use it for indexing *other* than getting the ordinal?
Forget (reference) arrays. They are broken.
Use java.util.EnumMap.
Tom Hawtin