Back to project page SeniorDesign.
The source code is released under:
GNU General Public License
If you think the Android project SeniorDesign listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package fakesetgame.seniordesign.model; //from ww w. j a va 2s . c om import java.util.HashMap; import java.util.Map; /** * An enumeration of possible tile shapes. */ public enum Shape { Oval(1), Diamond(2), Squiggle(3); private int numVal; private static Map<Integer, Shape> shapeMap = new HashMap<Integer, Shape>(); static{ for(Shape shapeEnum: Shape.values()){ shapeMap.put(shapeEnum.numVal, shapeEnum); } } private Shape(int numVal){ this.numVal = numVal; } public int getNumVal(){ return numVal; } public static Shape valueOf(int numVal){ return shapeMap.get(numVal); } }