View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.4.3</a>, using an XML
4    * Schema.
5    * $Id: ContentLevelType.java,v 1.14 2007/01/04 16:26:06 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.resource.types;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
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 ContentLevelType.
22   * 
23   * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:06 $
24   */
25  public class ContentLevelType implements java.io.Serializable {
26  
27  
28        //--------------------------/
29       //- Class/Member Variables -/
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 ContentLevelType VALUE_0 = new ContentLevelType(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 ContentLevelType VALUE_1 = new ContentLevelType(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 ContentLevelType VALUE_2 = new ContentLevelType(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 ContentLevelType VALUE_3 = new ContentLevelType(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 ContentLevelType VALUE_4 = new ContentLevelType(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 ContentLevelType VALUE_5 = new ContentLevelType(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 ContentLevelType VALUE_6 = new ContentLevelType(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 ContentLevelType VALUE_7 = new ContentLevelType(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 ContentLevelType VALUE_8 = new ContentLevelType(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      //- Constructors -/
140     //----------------/
141 
142     private ContentLevelType(int type, java.lang.String value) {
143         super();
144         this.type = type;
145         this.stringValue = value;
146     } //-- org.astrogrid.registry.beans.resource.types.ContentLevelType(int, java.lang.String)
147 
148 
149       //-----------/
150      //- Methods -/
151     //-----------/
152 
153     /***
154      * Method enumerateReturns an enumeration of all possible
155      * instances of ContentLevelType
156      */
157     public static java.util.Enumeration enumerate()
158     {
159         return _memberTable.elements();
160     } //-- java.util.Enumeration enumerate() 
161 
162     /***
163      * Method getTypeReturns the type of this ContentLevelType
164      */
165     public int getType()
166     {
167         return this.type;
168     } //-- int getType() 
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     } //-- java.util.Hashtable init() 
187 
188     /***
189      * Method toStringReturns the String representation of this
190      * ContentLevelType
191      */
192     public java.lang.String toString()
193     {
194         return this.stringValue;
195     } //-- java.lang.String toString() 
196 
197     /***
198      * Method valueOfReturns a new ContentLevelType based on the
199      * given String value.
200      * 
201      * @param string
202      */
203     public static org.astrogrid.registry.beans.resource.types.ContentLevelType 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 ContentLevelType";
209             throw new IllegalArgumentException(err);
210         }
211         return (ContentLevelType) obj;
212     } //-- org.astrogrid.registry.beans.resource.types.ContentLevelType valueOf(java.lang.String) 
213 
214 }