1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.resource.votable.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 VOTABLEVersionType.
22 *
23 * @version $Revision: 1.14 $ $Date: 2007/01/04 16:26:14 $
24 */
25 public class VOTABLEVersionType implements java.io.Serializable {
26
27
28
29
30
31
32 /***
33 * The 1.0 type
34 */
35 public static final int VALUE_0_TYPE = 0;
36
37 /***
38 * The instance of the 1.0 type
39 */
40 public static final VOTABLEVersionType VALUE_0 = new VOTABLEVersionType(VALUE_0_TYPE, "1.0");
41
42 /***
43 * Field _memberTable
44 */
45 private static java.util.Hashtable _memberTable = init();
46
47 /***
48 * Field type
49 */
50 private int type = -1;
51
52 /***
53 * Field stringValue
54 */
55 private java.lang.String stringValue = null;
56
57
58
59
60
61
62 private VOTABLEVersionType(int type, java.lang.String value) {
63 super();
64 this.type = type;
65 this.stringValue = value;
66 }
67
68
69
70
71
72
73 /***
74 * Method enumerateReturns an enumeration of all possible
75 * instances of VOTABLEVersionType
76 */
77 public static java.util.Enumeration enumerate()
78 {
79 return _memberTable.elements();
80 }
81
82 /***
83 * Method getTypeReturns the type of this VOTABLEVersionType
84 */
85 public int getType()
86 {
87 return this.type;
88 }
89
90 /***
91 * Method init
92 */
93 private static java.util.Hashtable init()
94 {
95 Hashtable members = new Hashtable();
96 members.put("1.0", VALUE_0);
97 return members;
98 }
99
100 /***
101 * Method toStringReturns the String representation of this
102 * VOTABLEVersionType
103 */
104 public java.lang.String toString()
105 {
106 return this.stringValue;
107 }
108
109 /***
110 * Method valueOfReturns a new VOTABLEVersionType based on the
111 * given String value.
112 *
113 * @param string
114 */
115 public static org.astrogrid.registry.beans.resource.votable.types.VOTABLEVersionType valueOf(java.lang.String string)
116 {
117 java.lang.Object obj = null;
118 if (string != null) obj = _memberTable.get(string);
119 if (obj == null) {
120 String err = "'" + string + "' is not a valid VOTABLEVersionType";
121 throw new IllegalArgumentException(err);
122 }
123 return (VOTABLEVersionType) obj;
124 }
125
126 }