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