View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.builder.binding.xml.types;
9   
10  /**
11   * Class FieldTypeCollectionType.
12   * 
13   * @version $Revision$ $Date$
14   */
15  public class FieldTypeCollectionType implements java.io.Serializable {
16  
17  
18        //--------------------------/
19       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * The array type
24       */
25      public static final int ARRAY_TYPE = 0;
26  
27      /**
28       * The instance of the array type
29       */
30      public static final FieldTypeCollectionType ARRAY = new FieldTypeCollectionType(ARRAY_TYPE, "array");
31  
32      /**
33       * The vector type
34       */
35      public static final int VECTOR_TYPE = 1;
36  
37      /**
38       * The instance of the vector type
39       */
40      public static final FieldTypeCollectionType VECTOR = new FieldTypeCollectionType(VECTOR_TYPE, "vector");
41  
42      /**
43       * The arraylist type
44       */
45      public static final int ARRAYLIST_TYPE = 2;
46  
47      /**
48       * The instance of the arraylist type
49       */
50      public static final FieldTypeCollectionType ARRAYLIST = new FieldTypeCollectionType(ARRAYLIST_TYPE, "arraylist");
51  
52      /**
53       * The hashtable type
54       */
55      public static final int HASHTABLE_TYPE = 3;
56  
57      /**
58       * The instance of the hashtable type
59       */
60      public static final FieldTypeCollectionType HASHTABLE = new FieldTypeCollectionType(HASHTABLE_TYPE, "hashtable");
61  
62      /**
63       * The collection type
64       */
65      public static final int COLLECTION_TYPE = 4;
66  
67      /**
68       * The instance of the collection type
69       */
70      public static final FieldTypeCollectionType COLLECTION = new FieldTypeCollectionType(COLLECTION_TYPE, "collection");
71  
72      /**
73       * The odmg type
74       */
75      public static final int ODMG_TYPE = 5;
76  
77      /**
78       * The instance of the odmg type
79       */
80      public static final FieldTypeCollectionType ODMG = new FieldTypeCollectionType(ODMG_TYPE, "odmg");
81  
82      /**
83       * The set type
84       */
85      public static final int SET_TYPE = 6;
86  
87      /**
88       * The instance of the set type
89       */
90      public static final FieldTypeCollectionType SET = new FieldTypeCollectionType(SET_TYPE, "set");
91  
92      /**
93       * The map type
94       */
95      public static final int MAP_TYPE = 7;
96  
97      /**
98       * The instance of the map type
99       */
100     public static final FieldTypeCollectionType MAP = new FieldTypeCollectionType(MAP_TYPE, "map");
101 
102     /**
103      * The sortedset type
104      */
105     public static final int SORTEDSET_TYPE = 8;
106 
107     /**
108      * The instance of the sortedset type
109      */
110     public static final FieldTypeCollectionType SORTEDSET = new FieldTypeCollectionType(SORTEDSET_TYPE, "sortedset");
111 
112     /**
113      * Field _memberTable.
114      */
115     private static java.util.Hashtable _memberTable = init();
116 
117     /**
118      * Field type.
119      */
120     private final int type;
121 
122     /**
123      * Field stringValue.
124      */
125     private java.lang.String stringValue = null;
126 
127 
128       //----------------/
129      //- Constructors -/
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      //- Methods -/
141     //-----------/
142 
143     /**
144      * Method enumerate.Returns an enumeration of all possible
145      * instances of FieldTypeCollectionType
146      * 
147      * @return an Enumeration over all possible instances of
148      * FieldTypeCollectionType
149      */
150     public static java.util.Enumeration enumerate(
151     ) {
152         return _memberTable.elements();
153     }
154 
155     /**
156      * Method getType.Returns the type of this
157      * FieldTypeCollectionType
158      * 
159      * @return the type of this FieldTypeCollectionType
160      */
161     public int getType(
162     ) {
163         return this.type;
164     }
165 
166     /**
167      * Method init.
168      * 
169      * @return the initialized Hashtable for the member table
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      * Method readResolve. will be called during deserialization to
188      * replace the deserialized object with the correct constant
189      * instance.
190      * 
191      * @return this deserialized object
192      */
193     private java.lang.Object readResolve(
194     ) {
195         return valueOf(this.stringValue);
196     }
197 
198     /**
199      * Method toString.Returns the String representation of this
200      * FieldTypeCollectionType
201      * 
202      * @return the String representation of this
203      * FieldTypeCollectionType
204      */
205     public java.lang.String toString(
206     ) {
207         return this.stringValue;
208     }
209 
210     /**
211      * Method valueOf.Returns a new FieldTypeCollectionType based
212      * on the given String value.
213      * 
214      * @param string
215      * @return the FieldTypeCollectionType value of parameter
216      * 'string'
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 }