1
2
3
4
5
6
7
8 package org.exolab.castor.builder.binding.xml.types;
9
10
11
12
13
14
15 public class FieldTypeCollectionType implements java.io.Serializable {
16
17
18
19
20
21
22
23
24
25 public static final int ARRAY_TYPE = 0;
26
27
28
29
30 public static final FieldTypeCollectionType ARRAY = new FieldTypeCollectionType(ARRAY_TYPE, "array");
31
32
33
34
35 public static final int VECTOR_TYPE = 1;
36
37
38
39
40 public static final FieldTypeCollectionType VECTOR = new FieldTypeCollectionType(VECTOR_TYPE, "vector");
41
42
43
44
45 public static final int ARRAYLIST_TYPE = 2;
46
47
48
49
50 public static final FieldTypeCollectionType ARRAYLIST = new FieldTypeCollectionType(ARRAYLIST_TYPE, "arraylist");
51
52
53
54
55 public static final int HASHTABLE_TYPE = 3;
56
57
58
59
60 public static final FieldTypeCollectionType HASHTABLE = new FieldTypeCollectionType(HASHTABLE_TYPE, "hashtable");
61
62
63
64
65 public static final int COLLECTION_TYPE = 4;
66
67
68
69
70 public static final FieldTypeCollectionType COLLECTION = new FieldTypeCollectionType(COLLECTION_TYPE, "collection");
71
72
73
74
75 public static final int ODMG_TYPE = 5;
76
77
78
79
80 public static final FieldTypeCollectionType ODMG = new FieldTypeCollectionType(ODMG_TYPE, "odmg");
81
82
83
84
85 public static final int SET_TYPE = 6;
86
87
88
89
90 public static final FieldTypeCollectionType SET = new FieldTypeCollectionType(SET_TYPE, "set");
91
92
93
94
95 public static final int MAP_TYPE = 7;
96
97
98
99
100 public static final FieldTypeCollectionType MAP = new FieldTypeCollectionType(MAP_TYPE, "map");
101
102
103
104
105 public static final int SORTEDSET_TYPE = 8;
106
107
108
109
110 public static final FieldTypeCollectionType SORTEDSET = new FieldTypeCollectionType(SORTEDSET_TYPE, "sortedset");
111
112
113
114
115 private static java.util.Hashtable _memberTable = init();
116
117
118
119
120 private final int type;
121
122
123
124
125 private java.lang.String stringValue = null;
126
127
128
129
130
131
132 private FieldTypeCollectionType(final int type, final java.lang.String value) {
133 super();
134 this.type = type;
135 this.stringValue = value;
136 }
137
138
139
140
141
142
143
144
145
146
147
148
149
150 public static java.util.Enumeration enumerate(
151 ) {
152 return _memberTable.elements();
153 }
154
155
156
157
158
159
160
161 public int getType(
162 ) {
163 return this.type;
164 }
165
166
167
168
169
170
171 private static java.util.Hashtable init(
172 ) {
173 java.util.Hashtable members = new java.util.Hashtable();
174 members.put("array", ARRAY);
175 members.put("vector", VECTOR);
176 members.put("arraylist", ARRAYLIST);
177 members.put("hashtable", HASHTABLE);
178 members.put("collection", COLLECTION);
179 members.put("odmg", ODMG);
180 members.put("set", SET);
181 members.put("map", MAP);
182 members.put("sortedset", SORTEDSET);
183 return members;
184 }
185
186
187
188
189
190
191
192
193 private java.lang.Object readResolve(
194 ) {
195 return valueOf(this.stringValue);
196 }
197
198
199
200
201
202
203
204
205 public java.lang.String toString(
206 ) {
207 return this.stringValue;
208 }
209
210
211
212
213
214
215
216
217
218 public static org.exolab.castor.builder.binding.xml.types.FieldTypeCollectionType valueOf(
219 final java.lang.String string) {
220 java.lang.Object obj = null;
221 if (string != null) {
222 obj = _memberTable.get(string);
223 }
224 if (obj == null) {
225 String err = "" + string + " is not a valid FieldTypeCollectionType";
226 throw new IllegalArgumentException(err);
227 }
228 return (FieldTypeCollectionType) obj;
229 }
230
231 }