Java5: From Ordinal Value To Enum Instance

The enum type introduced in Java5 is quite powerful, but I miss a factory method to get an enum instance from its ordinal value. The existing factory method in Enum.valueOf(Class, String) lets you get an enum instance from its type and name, but there is no valueOf which lets you get it from the ordinal [...]

February 5, 2008  Tags: ,   Posted in: Programming  2 Comments