1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.v10.resource.dataservice.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 * Class Waveband.
22 *
23 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:20 $
24 */
25 public class Waveband implements java.io.Serializable {
26
27
28
29
30
31
32 /***
33 * The Radio type
34 */
35 public static final int VALUE_0_TYPE = 0;
36
37 /***
38 * The instance of the Radio type
39 */
40 public static final Waveband VALUE_0 = new Waveband(VALUE_0_TYPE, "Radio");
41
42 /***
43 * The Millimeter type
44 */
45 public static final int VALUE_1_TYPE = 1;
46
47 /***
48 * The instance of the Millimeter type
49 */
50 public static final Waveband VALUE_1 = new Waveband(VALUE_1_TYPE, "Millimeter");
51
52 /***
53 * The Infrared type
54 */
55 public static final int VALUE_2_TYPE = 2;
56
57 /***
58 * The instance of the Infrared type
59 */
60 public static final Waveband VALUE_2 = new Waveband(VALUE_2_TYPE, "Infrared");
61
62 /***
63 * The Optical type
64 */
65 public static final int VALUE_3_TYPE = 3;
66
67 /***
68 * The instance of the Optical type
69 */
70 public static final Waveband VALUE_3 = new Waveband(VALUE_3_TYPE, "Optical");
71
72 /***
73 * The UV type
74 */
75 public static final int VALUE_4_TYPE = 4;
76
77 /***
78 * The instance of the UV type
79 */
80 public static final Waveband VALUE_4 = new Waveband(VALUE_4_TYPE, "UV");
81
82 /***
83 * The EUV type
84 */
85 public static final int VALUE_5_TYPE = 5;
86
87 /***
88 * The instance of the EUV type
89 */
90 public static final Waveband VALUE_5 = new Waveband(VALUE_5_TYPE, "EUV");
91
92 /***
93 * The X-ray type
94 */
95 public static final int VALUE_6_TYPE = 6;
96
97 /***
98 * The instance of the X-ray type
99 */
100 public static final Waveband VALUE_6 = new Waveband(VALUE_6_TYPE, "X-ray");
101
102 /***
103 * The Gamma-ray type
104 */
105 public static final int VALUE_7_TYPE = 7;
106
107 /***
108 * The instance of the Gamma-ray type
109 */
110 public static final Waveband VALUE_7 = new Waveband(VALUE_7_TYPE, "Gamma-ray");
111
112 /***
113 * Field _memberTable
114 */
115 private static java.util.Hashtable _memberTable = init();
116
117 /***
118 * Field type
119 */
120 private int type = -1;
121
122 /***
123 * Field stringValue
124 */
125 private java.lang.String stringValue = null;
126
127
128
129
130
131
132 private Waveband(int type, java.lang.String value) {
133 super();
134 this.type = type;
135 this.stringValue = value;
136 }
137
138
139
140
141
142
143 /***
144 * Method enumerateReturns an enumeration of all possible
145 * instances of Waveband
146 */
147 public static java.util.Enumeration enumerate()
148 {
149 return _memberTable.elements();
150 }
151
152 /***
153 * Method getTypeReturns the type of this Waveband
154 */
155 public int getType()
156 {
157 return this.type;
158 }
159
160 /***
161 * Method init
162 */
163 private static java.util.Hashtable init()
164 {
165 Hashtable members = new Hashtable();
166 members.put("Radio", VALUE_0);
167 members.put("Millimeter", VALUE_1);
168 members.put("Infrared", VALUE_2);
169 members.put("Optical", VALUE_3);
170 members.put("UV", VALUE_4);
171 members.put("EUV", VALUE_5);
172 members.put("X-ray", VALUE_6);
173 members.put("Gamma-ray", VALUE_7);
174 return members;
175 }
176
177 /***
178 * Method toStringReturns the String representation of this
179 * Waveband
180 */
181 public java.lang.String toString()
182 {
183 return this.stringValue;
184 }
185
186 /***
187 * Method valueOfReturns a new Waveband based on the given
188 * String value.
189 *
190 * @param string
191 */
192 public static org.astrogrid.registry.beans.v10.resource.dataservice.types.Waveband valueOf(java.lang.String string)
193 {
194 java.lang.Object obj = null;
195 if (string != null) obj = _memberTable.get(string);
196 if (obj == null) {
197 String err = "'" + string + "' is not a valid Waveband";
198 throw new IllegalArgumentException(err);
199 }
200 return (Waveband) obj;
201 }
202
203 }