2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.binding.types;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import java.util.Hashtable;
17 * Class ColourNoValueColourType.
19 * @version $Revision$ $Date$
21 public class ColourNoValueColourType implements java.io.Serializable {
24 //--------------------------/
25 //- Class/Member Variables -/
26 //--------------------------/
31 public static final int NONE_TYPE = 0;
34 * The instance of the None type
36 public static final ColourNoValueColourType NONE = new ColourNoValueColourType(NONE_TYPE, "None");
41 public static final int MIN_TYPE = 1;
44 * The instance of the Min type
46 public static final ColourNoValueColourType MIN = new ColourNoValueColourType(MIN_TYPE, "Min");
51 public static final int MAX_TYPE = 2;
54 * The instance of the Max type
56 public static final ColourNoValueColourType MAX = new ColourNoValueColourType(MAX_TYPE, "Max");
61 private static java.util.Hashtable _memberTable = init();
66 private int type = -1;
71 private java.lang.String stringValue = null;
78 private ColourNoValueColourType(final int type, final java.lang.String value) {
81 this.stringValue = value;
90 * Method enumerate.Returns an enumeration of all possible
91 * instances of ColourNoValueColourType
93 * @return an Enumeration over all possible instances of
94 * ColourNoValueColourType
96 public static java.util.Enumeration enumerate(
98 return _memberTable.elements();
102 * Method getType.Returns the type of this
103 * ColourNoValueColourType
105 * @return the type of this ColourNoValueColourType
115 * @return the initialized Hashtable for the member table
117 private static java.util.Hashtable init(
119 Hashtable members = new Hashtable();
120 members.put("None", NONE);
121 members.put("Min", MIN);
122 members.put("Max", MAX);
127 * Method readResolve. will be called during deserialization to
128 * replace the deserialized object with the correct constant
131 * @return this deserialized object
133 private java.lang.Object readResolve(
135 return valueOf(this.stringValue);
139 * Method toString.Returns the String representation of this
140 * ColourNoValueColourType
142 * @return the String representation of this
143 * ColourNoValueColourType
145 public java.lang.String toString(
147 return this.stringValue;
151 * Method valueOf.Returns a new ColourNoValueColourType based
152 * on the given String value.
155 * @return the ColourNoValueColourType value of parameter
158 public static jalview.binding.types.ColourNoValueColourType valueOf(
159 final java.lang.String string) {
160 java.lang.Object obj = null;
161 if (string != null) {
162 obj = _memberTable.get(string);
165 String err = "" + string + " is not a valid ColourNoValueColourType";
166 throw new IllegalArgumentException(err);
168 return (ColourNoValueColourType) obj;