1 19 20 package org.apache.cayenne.dataview; 21 22 import java.util.*; 23 import org.apache.commons.lang.enums.ValuedEnum; 24 25 public class CalcTypeEnum extends ValuedEnum { 26 public static final int NO_CALC_TYPE_VALUE = 1; 27 public static final int CALC_TYPE_VALUE = 2; 28 public static final int LOOKUP_TYPE_VALUE = 3; 29 30 public static final String NO_CALC_TYPE_NAME = "nocalc"; 31 public static final String CALC_TYPE_NAME = "calc"; 32 public static final String LOOKUP_TYPE_NAME = "lookup"; 33 34 public static final CalcTypeEnum NO_CALC_TYPE = new CalcTypeEnum( NO_CALC_TYPE_NAME, NO_CALC_TYPE_VALUE ); 35 public static final CalcTypeEnum CALC_TYPE = new CalcTypeEnum( CALC_TYPE_NAME, CALC_TYPE_VALUE ); 36 public static final CalcTypeEnum LOOKUP_TYPE = new CalcTypeEnum( LOOKUP_TYPE_NAME, LOOKUP_TYPE_VALUE ); 37 38 protected CalcTypeEnum(String name, int value) { 39 super(name, value); 40 } 41 42 public static CalcTypeEnum getEnum(String calcType) { 43 return (CalcTypeEnum) getEnum(CalcTypeEnum.class, calcType); 44 } 45 46 public static CalcTypeEnum getEnum(int calcType) { 47 return (CalcTypeEnum) getEnum(CalcTypeEnum.class, calcType); 48 } 49 50 public static Map getEnumMap() { 51 return getEnumMap(CalcTypeEnum.class); 52 } 53 54 public static List getEnumList() { 55 return getEnumList(CalcTypeEnum.class); 56 } 57 58 public static Iterator iterator() { 59 return iterator(CalcTypeEnum.class); 60 } 61 62 public final Class getEnumClass() { 63 return CalcTypeEnum.class; 64 } 65 } 66 | Popular Tags |