View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package fr.in2p3.jsaga.engine.schema.config.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 SetOperationType.
22   * 
23   * @version $Revision$ $Date$
24   */
25  public class SetOperationType implements java.io.Serializable {
26  
27  
28        //--------------------------/
29       //- Class/Member Variables -/
30      //--------------------------/
31  
32      /**
33       * The union type
34       */
35      public static final int UNION_TYPE = 0;
36  
37      /**
38       * The instance of the union type
39       */
40      public static final SetOperationType UNION = new SetOperationType(UNION_TYPE, "union");
41  
42      /**
43       * The intersection type
44       */
45      public static final int INTERSECTION_TYPE = 1;
46  
47      /**
48       * The instance of the intersection type
49       */
50      public static final SetOperationType INTERSECTION = new SetOperationType(INTERSECTION_TYPE, "intersection");
51  
52      /**
53       * The substraction type
54       */
55      public static final int SUBSTRACTION_TYPE = 2;
56  
57      /**
58       * The instance of the substraction type
59       */
60      public static final SetOperationType SUBSTRACTION = new SetOperationType(SUBSTRACTION_TYPE, "substraction");
61  
62      /**
63       * Field _memberTable
64       */
65      private static java.util.Hashtable _memberTable = init();
66  
67      /**
68       * Field type
69       */
70      private int type = -1;
71  
72      /**
73       * Field stringValue
74       */
75      private java.lang.String stringValue = null;
76  
77  
78        //----------------/
79       //- Constructors -/
80      //----------------/
81  
82      private SetOperationType(int type, java.lang.String value) 
83       {
84          super();
85          this.type = type;
86          this.stringValue = value;
87      } //-- fr.in2p3.jsaga.engine.schema.config.types.SetOperationType(int, java.lang.String)
88  
89  
90        //-----------/
91       //- Methods -/
92      //-----------/
93  
94      /**
95       * Method enumerate
96       * 
97       * Returns an enumeration of all possible instances of
98       * SetOperationType
99       * 
100      * @return Enumeration
101      */
102     public static java.util.Enumeration enumerate()
103     {
104         return _memberTable.elements();
105     } //-- java.util.Enumeration enumerate() 
106 
107     /**
108      * Method getType
109      * 
110      * Returns the type of this SetOperationType
111      * 
112      * @return int
113      */
114     public int getType()
115     {
116         return this.type;
117     } //-- int getType() 
118 
119     /**
120      * Method init
121      * 
122      * 
123      * 
124      * @return Hashtable
125      */
126     private static java.util.Hashtable init()
127     {
128         Hashtable members = new Hashtable();
129         members.put("union", UNION);
130         members.put("intersection", INTERSECTION);
131         members.put("substraction", SUBSTRACTION);
132         return members;
133     } //-- java.util.Hashtable init() 
134 
135     /**
136      * Method readResolve
137      * 
138      *  will be called during deserialization to replace the
139      * deserialized object with the correct constant instance.
140      * <br/>
141      * 
142      * @return Object
143      */
144     private java.lang.Object readResolve()
145     {
146         return valueOf(this.stringValue);
147     } //-- java.lang.Object readResolve() 
148 
149     /**
150      * Method toString
151      * 
152      * Returns the String representation of this SetOperationType
153      * 
154      * @return String
155      */
156     public java.lang.String toString()
157     {
158         return this.stringValue;
159     } //-- java.lang.String toString() 
160 
161     /**
162      * Method valueOf
163      * 
164      * Returns a new SetOperationType based on the given String
165      * value.
166      * 
167      * @param string
168      * @return SetOperationType
169      */
170     public static fr.in2p3.jsaga.engine.schema.config.types.SetOperationType 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 SetOperationType";
176             throw new IllegalArgumentException(err);
177         }
178         return (SetOperationType) obj;
179     } //-- fr.in2p3.jsaga.engine.schema.config.types.SetOperationType valueOf(java.lang.String) 
180 
181 }