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 FeatureMatcherByType.
19 * @version $Revision$ $Date$
21 public class FeatureMatcherByType implements java.io.Serializable {
24 //--------------------------/
25 //- Class/Member Variables -/
26 //--------------------------/
31 public static final int BYLABEL_TYPE = 0;
34 * The instance of the byLabel type
36 public static final FeatureMatcherByType BYLABEL = new FeatureMatcherByType(BYLABEL_TYPE, "byLabel");
41 public static final int BYSCORE_TYPE = 1;
44 * The instance of the byScore type
46 public static final FeatureMatcherByType BYSCORE = new FeatureMatcherByType(BYSCORE_TYPE, "byScore");
49 * The byAttribute type
51 public static final int BYATTRIBUTE_TYPE = 2;
54 * The instance of the byAttribute type
56 public static final FeatureMatcherByType BYATTRIBUTE = new FeatureMatcherByType(BYATTRIBUTE_TYPE, "byAttribute");
61 private static java.util.Hashtable _memberTable = init();
66 private int type = -1;
71 private java.lang.String stringValue = null;
78 private FeatureMatcherByType(final int type, final java.lang.String value) {
81 this.stringValue = value;
90 * Method enumerate.Returns an enumeration of all possible
91 * instances of FeatureMatcherByType
93 * @return an Enumeration over all possible instances of
94 * FeatureMatcherByType
96 public static java.util.Enumeration enumerate(
98 return _memberTable.elements();
102 * Method getType.Returns the type of this FeatureMatcherByType
104 * @return the type of this FeatureMatcherByType
114 * @return the initialized Hashtable for the member table
116 private static java.util.Hashtable init(
118 Hashtable members = new Hashtable();
119 members.put("byLabel", BYLABEL);
120 members.put("byScore", BYSCORE);
121 members.put("byAttribute", BYATTRIBUTE);
126 * Method readResolve. will be called during deserialization to
127 * replace the deserialized object with the correct constant
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
139 * FeatureMatcherByType
141 * @return the String representation of this FeatureMatcherByTyp
143 public java.lang.String toString(
145 return this.stringValue;
149 * Method valueOf.Returns a new FeatureMatcherByType based on
150 * the given String value.
153 * @return the FeatureMatcherByType value of parameter 'string'
155 public static jalview.binding.types.FeatureMatcherByType valueOf(
156 final java.lang.String string) {
157 java.lang.Object obj = null;
158 if (string != null) {
159 obj = _memberTable.get(string);
162 String err = "" + string + " is not a valid FeatureMatcherByType";
163 throw new IllegalArgumentException(err);
165 return (FeatureMatcherByType) obj;