1 16 package org.apache.commons.lang.enum; 17 18 import java.util.Iterator; 19 import java.util.List; 20 import java.util.Map; 21 22 28 public abstract class Broken1OperationEnum extends Enum { 29 public static final Broken1OperationEnum PLUS = new PlusOperation(); 42 private static class PlusOperation extends Broken1OperationEnum { 43 private PlusOperation() { 44 super("Plus"); 45 } 46 public int eval(int a, int b) { 47 return (a + b); 48 } 49 } 50 public static final Broken1OperationEnum MINUS = new MinusOperation(); 51 private static class MinusOperation extends Broken1OperationEnum { 52 private MinusOperation() { 53 super("Minus"); 54 } 55 public int eval(int a, int b) { 56 return (a - b); 57 } 58 } 59 60 private Broken1OperationEnum(String name) { 61 super(name); 62 } 63 64 public final Class getEnumClass() { 65 return null; 66 } 67 68 public abstract int eval(int a, int b); 69 70 public static Broken1OperationEnum getEnum(String name) { 71 return (Broken1OperationEnum) getEnum(Broken1OperationEnum.class, name); 72 } 73 74 public static Map getEnumMap() { 75 return getEnumMap(Broken1OperationEnum.class); 76 } 77 78 public static List getEnumList() { 79 return getEnumList(Broken1OperationEnum.class); 80 } 81 82 public static Iterator iterator() { 83 return iterator(Broken1OperationEnum.class); 84 } 85 } 86 | Popular Tags |