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: CoordFrame.java,v 1.2 2007/01/04 16:26:19 clq2 Exp $
6    */
7   
8   package org.astrogrid.registry.beans.v10.resource.dataservice.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 CoordFrame.
22   * 
23   * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:19 $
24   */
25  public class CoordFrame implements java.io.Serializable {
26  
27  
28        //--------------------------/
29       //- Class/Member Variables -/
30      //--------------------------/
31  
32      /***
33       * The ICRS type
34       */
35      public static final int ICRS_TYPE = 0;
36  
37      /***
38       * The instance of the ICRS type
39       */
40      public static final CoordFrame ICRS = new CoordFrame(ICRS_TYPE, "ICRS");
41  
42      /***
43       * The FK5 type
44       */
45      public static final int FK5_TYPE = 1;
46  
47      /***
48       * The instance of the FK5 type
49       */
50      public static final CoordFrame FK5 = new CoordFrame(FK5_TYPE, "FK5");
51  
52      /***
53       * The FK4 type
54       */
55      public static final int FK4_TYPE = 2;
56  
57      /***
58       * The instance of the FK4 type
59       */
60      public static final CoordFrame FK4 = new CoordFrame(FK4_TYPE, "FK4");
61  
62      /***
63       * The ECL type
64       */
65      public static final int ECL_TYPE = 3;
66  
67      /***
68       * The instance of the ECL type
69       */
70      public static final CoordFrame ECL = new CoordFrame(ECL_TYPE, "ECL");
71  
72      /***
73       * The GAL type
74       */
75      public static final int GAL_TYPE = 4;
76  
77      /***
78       * The instance of the GAL type
79       */
80      public static final CoordFrame GAL = new CoordFrame(GAL_TYPE, "GAL");
81  
82      /***
83       * The SGAL type
84       */
85      public static final int SGAL_TYPE = 5;
86  
87      /***
88       * The instance of the SGAL type
89       */
90      public static final CoordFrame SGAL = new CoordFrame(SGAL_TYPE, "SGAL");
91  
92      /***
93       * Field _memberTable
94       */
95      private static java.util.Hashtable _memberTable = init();
96  
97      /***
98       * Field type
99       */
100     private int type = -1;
101 
102     /***
103      * Field stringValue
104      */
105     private java.lang.String stringValue = null;
106 
107 
108       //----------------/
109      //- Constructors -/
110     //----------------/
111 
112     private CoordFrame(int type, java.lang.String value) {
113         super();
114         this.type = type;
115         this.stringValue = value;
116     } //-- org.astrogrid.registry.beans.v10.resource.dataservice.types.CoordFrame(int, java.lang.String)
117 
118 
119       //-----------/
120      //- Methods -/
121     //-----------/
122 
123     /***
124      * Method enumerateReturns an enumeration of all possible
125      * instances of CoordFrame
126      */
127     public static java.util.Enumeration enumerate()
128     {
129         return _memberTable.elements();
130     } //-- java.util.Enumeration enumerate() 
131 
132     /***
133      * Method getTypeReturns the type of this CoordFrame
134      */
135     public int getType()
136     {
137         return this.type;
138     } //-- int getType() 
139 
140     /***
141      * Method init
142      */
143     private static java.util.Hashtable init()
144     {
145         Hashtable members = new Hashtable();
146         members.put("ICRS", ICRS);
147         members.put("FK5", FK5);
148         members.put("FK4", FK4);
149         members.put("ECL", ECL);
150         members.put("GAL", GAL);
151         members.put("SGAL", SGAL);
152         return members;
153     } //-- java.util.Hashtable init() 
154 
155     /***
156      * Method toStringReturns the String representation of this
157      * CoordFrame
158      */
159     public java.lang.String toString()
160     {
161         return this.stringValue;
162     } //-- java.lang.String toString() 
163 
164     /***
165      * Method valueOfReturns a new CoordFrame based on the given
166      * String value.
167      * 
168      * @param string
169      */
170     public static org.astrogrid.registry.beans.v10.resource.dataservice.types.CoordFrame valueOf(java.lang.String string)
171     {
172         java.lang.Object obj = null;
173         if (string != null) obj = _memberTable.get(string);
174         if (obj == null) {
175             String err = "'" + string + "' is not a valid CoordFrame";
176             throw new IllegalArgumentException(err);
177         }
178         return (CoordFrame) obj;
179     } //-- org.astrogrid.registry.beans.v10.resource.dataservice.types.CoordFrame valueOf(java.lang.String) 
180 
181 }