JAL-2843 schema and code changes to save colour by attribute and filters in user...
[jalview.git] / src / jalview / schemabinding / version2 / types / ColourNoValueColourType.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.types;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.util.Hashtable;
15
16 /**
17  * Class ColourNoValueColourType.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class ColourNoValueColourType implements java.io.Serializable {
22
23
24       //--------------------------/
25      //- Class/Member Variables -/
26     //--------------------------/
27
28     /**
29      * The None type
30      */
31     public static final int NONE_TYPE = 0;
32
33     /**
34      * The instance of the None type
35      */
36     public static final ColourNoValueColourType NONE = new ColourNoValueColourType(NONE_TYPE, "None");
37
38     /**
39      * The Min type
40      */
41     public static final int MIN_TYPE = 1;
42
43     /**
44      * The instance of the Min type
45      */
46     public static final ColourNoValueColourType MIN = new ColourNoValueColourType(MIN_TYPE, "Min");
47
48     /**
49      * The Max type
50      */
51     public static final int MAX_TYPE = 2;
52
53     /**
54      * The instance of the Max type
55      */
56     public static final ColourNoValueColourType MAX = new ColourNoValueColourType(MAX_TYPE, "Max");
57
58     /**
59      * Field _memberTable.
60      */
61     private static java.util.Hashtable _memberTable = init();
62
63     /**
64      * Field type.
65      */
66     private int type = -1;
67
68     /**
69      * Field stringValue.
70      */
71     private java.lang.String stringValue = null;
72
73
74       //----------------/
75      //- Constructors -/
76     //----------------/
77
78     private ColourNoValueColourType(final int type, final java.lang.String value) {
79         super();
80         this.type = type;
81         this.stringValue = value;
82     }
83
84
85       //-----------/
86      //- Methods -/
87     //-----------/
88
89     /**
90      * Method enumerate.Returns an enumeration of all possible
91      * instances of ColourNoValueColourType
92      * 
93      * @return an Enumeration over all possible instances of
94      * ColourNoValueColourType
95      */
96     public static java.util.Enumeration enumerate(
97     ) {
98         return _memberTable.elements();
99     }
100
101     /**
102      * Method getType.Returns the type of this
103      * ColourNoValueColourType
104      * 
105      * @return the type of this ColourNoValueColourType
106      */
107     public int getType(
108     ) {
109         return this.type;
110     }
111
112     /**
113      * Method init.
114      * 
115      * @return the initialized Hashtable for the member table
116      */
117     private static java.util.Hashtable init(
118     ) {
119         Hashtable members = new Hashtable();
120         members.put("None", NONE);
121         members.put("Min", MIN);
122         members.put("Max", MAX);
123         return members;
124     }
125
126     /**
127      * Method readResolve. will be called during deserialization to
128      * replace the deserialized object with the correct constant
129      * instance.
130      * 
131      * @return this deserialized object
132      */
133     private java.lang.Object readResolve(
134     ) {
135         return valueOf(this.stringValue);
136     }
137
138     /**
139      * Method toString.Returns the String representation of this
140      * ColourNoValueColourType
141      * 
142      * @return the String representation of this
143      * ColourNoValueColourType
144      */
145     public java.lang.String toString(
146     ) {
147         return this.stringValue;
148     }
149
150     /**
151      * Method valueOf.Returns a new ColourNoValueColourType based
152      * on the given String value.
153      * 
154      * @param string
155      * @return the ColourNoValueColourType value of parameter
156      * 'string'
157      */
158     public static jalview.schemabinding.version2.types.ColourNoValueColourType valueOf(
159             final java.lang.String string) {
160         java.lang.Object obj = null;
161         if (string != null) {
162             obj = _memberTable.get(string);
163         }
164         if (obj == null) {
165             String err = "" + string + " is not a valid ColourNoValueColourType";
166             throw new IllegalArgumentException(err);
167         }
168         return (ColourNoValueColourType) obj;
169     }
170
171 }