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