1 56 package org.objectstyle.cayenne.dataview; 57 58 import java.util.*; 59 import org.apache.commons.lang.enums.ValuedEnum; 60 61 public class CalcTypeEnum extends ValuedEnum { 62 public static final int NO_CALC_TYPE_VALUE = 1; 63 public static final int CALC_TYPE_VALUE = 2; 64 public static final int LOOKUP_TYPE_VALUE = 3; 65 66 public static final String NO_CALC_TYPE_NAME = "nocalc"; 67 public static final String CALC_TYPE_NAME = "calc"; 68 public static final String LOOKUP_TYPE_NAME = "lookup"; 69 70 public static final CalcTypeEnum NO_CALC_TYPE = new CalcTypeEnum( NO_CALC_TYPE_NAME, NO_CALC_TYPE_VALUE ); 71 public static final CalcTypeEnum CALC_TYPE = new CalcTypeEnum( CALC_TYPE_NAME, CALC_TYPE_VALUE ); 72 public static final CalcTypeEnum LOOKUP_TYPE = new CalcTypeEnum( LOOKUP_TYPE_NAME, LOOKUP_TYPE_VALUE ); 73 74 protected CalcTypeEnum(String name, int value) { 75 super(name, value); 76 } 77 78 public static CalcTypeEnum getEnum(String calcType) { 79 return (CalcTypeEnum) getEnum(CalcTypeEnum.class, calcType); 80 } 81 82 public static CalcTypeEnum getEnum(int calcType) { 83 return (CalcTypeEnum) getEnum(CalcTypeEnum.class, calcType); 84 } 85 86 public static Map getEnumMap() { 87 return getEnumMap(CalcTypeEnum.class); 88 } 89 90 public static List getEnumList() { 91 return getEnumList(CalcTypeEnum.class); 92 } 93 94 public static Iterator iterator() { 95 return iterator(CalcTypeEnum.class); 96 } 97 98 public final Class getEnumClass() { 99 return CalcTypeEnum.class; 100 } 101 } | Popular Tags |