Description
Below is an EnumUtils for JDK 1.5. It's also found in the enums.EnumUtils javadoc:
import java.util.*;
public class EnumUtils {
public static Enum getEnum(Class enumClass, String token)
{ return Enum.valueOf(enumClass, token); } public static Map getEnumMap(Class enumClass) {
HashMap map = new HashMap();
Iterator itr = EnumUtils.iterator(enumClass);
while(itr.hasNext())
return map;
}
public static List getEnumList(Class enumClass)
{ return new ArrayList( EnumSet.allOf(enumClass) ); }public static Iterator iterator(Class enumClass)
{ return EnumUtils.getEnumList(enumClass).iterator(); }}