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 * Graduated feature colour if no score (or attribute) value
19 * @version $Revision$ $Date$
21 public class NoValueColour 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 NoValueColour NONE = new NoValueColour(NONE_TYPE,
42 public static final int MIN_TYPE = 1;
45 * The instance of the Min type
47 public static final NoValueColour MIN = new NoValueColour(MIN_TYPE,
53 public static final int MAX_TYPE = 2;
56 * The instance of the Max type
58 public static final NoValueColour MAX = new NoValueColour(MAX_TYPE,
64 private static java.util.Hashtable _memberTable = init();
69 private int type = -1;
74 private java.lang.String stringValue = null;
80 private NoValueColour(final int type, final java.lang.String value)
84 this.stringValue = value;
92 * Method enumerate.Returns an enumeration of all possible instances of
95 * @return an Enumeration over all possible instances of NoValueColour
97 public static java.util.Enumeration enumerate()
99 return _memberTable.elements();
103 * Method getType.Returns the type of this NoValueColour
105 * @return the type of this NoValueColour
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 replace the
128 * deserialized object with the correct constant instance.
130 * @return this deserialized object
132 private java.lang.Object readResolve()
134 return valueOf(this.stringValue);
138 * Method toString.Returns the String representation of this NoValueColour
140 * @return the String representation of this NoValueColour
142 public java.lang.String toString()
144 return this.stringValue;
148 * Method valueOf.Returns a new NoValueColour based on the given String value.
151 * @return the NoValueColour value of parameter 'string'
153 public static jalview.binding.types.NoValueColour valueOf(
154 final java.lang.String string)
156 java.lang.Object obj = null;
159 obj = _memberTable.get(string);
163 String err = "" + string + " is not a valid NoValueColour";
164 throw new IllegalArgumentException(err);
166 return (NoValueColour) obj;