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