1
2
3
4
5
6
7
8 package org.astrogrid.applications.beans.v1.parameters.types;
9
10
11
12
13
14 import java.io.Serializable;
15 import java.util.Enumeration;
16 import java.util.Hashtable;
17 import org.exolab.castor.xml.Marshaller;
18 import org.exolab.castor.xml.Unmarshaller;
19
20 /***
21 * The list of possible parameter typesThe enumeration values
22 * should have the namespace appended? I have removed them to make
23 * castor generate nicer objects
24 *
25 * @version $Revision: 1.33 $ $Date: 2005/01/23 12:52:30 $
26 */
27 public class ParameterTypes implements java.io.Serializable {
28
29
30
31
32
33
34 /***
35 * The integer type
36 */
37 public static final int INTEGER_TYPE = 0;
38
39 /***
40 * The instance of the integer type
41 */
42 public static final ParameterTypes INTEGER = new ParameterTypes(INTEGER_TYPE, "integer");
43
44 /***
45 * The real type
46 */
47 public static final int REAL_TYPE = 1;
48
49 /***
50 * The instance of the real type
51 */
52 public static final ParameterTypes REAL = new ParameterTypes(REAL_TYPE, "real");
53
54 /***
55 * The complex type
56 */
57 public static final int COMPLEX_TYPE = 2;
58
59 /***
60 * The instance of the complex type
61 */
62 public static final ParameterTypes COMPLEX = new ParameterTypes(COMPLEX_TYPE, "complex");
63
64 /***
65 * The double type
66 */
67 public static final int DOUBLE_TYPE = 3;
68
69 /***
70 * The instance of the double type
71 */
72 public static final ParameterTypes DOUBLE = new ParameterTypes(DOUBLE_TYPE, "double");
73
74 /***
75 * The text type
76 */
77 public static final int TEXT_TYPE = 4;
78
79 /***
80 * The instance of the text type
81 */
82 public static final ParameterTypes TEXT = new ParameterTypes(TEXT_TYPE, "text");
83
84 /***
85 * The boolean type
86 */
87 public static final int BOOLEAN_TYPE = 5;
88
89 /***
90 * The instance of the boolean type
91 */
92 public static final ParameterTypes BOOLEAN = new ParameterTypes(BOOLEAN_TYPE, "boolean");
93
94 /***
95 * The anyURI type
96 */
97 public static final int ANYURI_TYPE = 6;
98
99 /***
100 * The instance of the anyURI type
101 */
102 public static final ParameterTypes ANYURI = new ParameterTypes(ANYURI_TYPE, "anyURI");
103
104 /***
105 * The anyXML type
106 */
107 public static final int ANYXML_TYPE = 7;
108
109 /***
110 * The instance of the anyXML type
111 */
112 public static final ParameterTypes ANYXML = new ParameterTypes(ANYXML_TYPE, "anyXML");
113
114 /***
115 * The VOTable type
116 */
117 public static final int VOTABLE_TYPE = 8;
118
119 /***
120 * The instance of the VOTable type
121 */
122 public static final ParameterTypes VOTABLE = new ParameterTypes(VOTABLE_TYPE, "VOTable");
123
124 /***
125 * The RA type
126 */
127 public static final int RA_TYPE = 9;
128
129 /***
130 * The instance of the RA type
131 */
132 public static final ParameterTypes RA = new ParameterTypes(RA_TYPE, "RA");
133
134 /***
135 * The Dec type
136 */
137 public static final int DEC_TYPE = 10;
138
139 /***
140 * The instance of the Dec type
141 */
142 public static final ParameterTypes DEC = new ParameterTypes(DEC_TYPE, "Dec");
143
144 /***
145 * The ADQL type
146 */
147 public static final int ADQL_TYPE = 11;
148
149 /***
150 * The instance of the ADQL type
151 */
152 public static final ParameterTypes ADQL = new ParameterTypes(ADQL_TYPE, "ADQL");
153
154 /***
155 * The binary type
156 */
157 public static final int BINARY_TYPE = 12;
158
159 /***
160 * The instance of the binary type
161 */
162 public static final ParameterTypes BINARY = new ParameterTypes(BINARY_TYPE, "binary");
163
164 /***
165 * The FITS type
166 */
167 public static final int FITS_TYPE = 13;
168
169 /***
170 * The instance of the FITS type
171 */
172 public static final ParameterTypes FITS = new ParameterTypes(FITS_TYPE, "FITS");
173
174 /***
175 * Field _memberTable
176 */
177 private static java.util.Hashtable _memberTable = init();
178
179 /***
180 * Field type
181 */
182 private int type = -1;
183
184 /***
185 * Field stringValue
186 */
187 private java.lang.String stringValue = null;
188
189
190
191
192
193
194 private ParameterTypes(int type, java.lang.String value) {
195 super();
196 this.type = type;
197 this.stringValue = value;
198 }
199
200
201
202
203
204
205 /***
206 * Method enumerateReturns an enumeration of all possible
207 * instances of ParameterTypes
208 */
209 public static java.util.Enumeration enumerate()
210 {
211 return _memberTable.elements();
212 }
213
214 /***
215 * Method getTypeReturns the type of this ParameterTypes
216 */
217 public int getType()
218 {
219 return this.type;
220 }
221
222 /***
223 * Method init
224 */
225 private static java.util.Hashtable init()
226 {
227 Hashtable members = new Hashtable();
228 members.put("integer", INTEGER);
229 members.put("real", REAL);
230 members.put("complex", COMPLEX);
231 members.put("double", DOUBLE);
232 members.put("text", TEXT);
233 members.put("boolean", BOOLEAN);
234 members.put("anyURI", ANYURI);
235 members.put("anyXML", ANYXML);
236 members.put("VOTable", VOTABLE);
237 members.put("RA", RA);
238 members.put("Dec", DEC);
239 members.put("ADQL", ADQL);
240 members.put("binary", BINARY);
241 members.put("FITS", FITS);
242 return members;
243 }
244
245 /***
246 * Method toStringReturns the String representation of this
247 * ParameterTypes
248 */
249 public java.lang.String toString()
250 {
251 return this.stringValue;
252 }
253
254 /***
255 * Method valueOfReturns a new ParameterTypes based on the
256 * given String value.
257 *
258 * @param string
259 */
260 public static org.astrogrid.applications.beans.v1.parameters.types.ParameterTypes valueOf(java.lang.String string)
261 {
262 java.lang.Object obj = null;
263 if (string != null) obj = _memberTable.get(string);
264 if (obj == null) {
265 String err = "'" + string + "' is not a valid ParameterTypes";
266 throw new IllegalArgumentException(err);
267 }
268 return (ParameterTypes) obj;
269 }
270
271 }