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.adaptor.schema.job.emulator.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 JobStatusType.
22   * 
23   * @version $Revision$ $Date$
24   */
25  public class JobStatusType implements java.io.Serializable {
26  
27  
28        //--------------------------/
29       //- Class/Member Variables -/
30      //--------------------------/
31  
32      /**
33       * The SUBMITTED type
34       */
35      public static final int SUBMITTED_TYPE = 0;
36  
37      /**
38       * The instance of the SUBMITTED type
39       */
40      public static final JobStatusType SUBMITTED = new JobStatusType(SUBMITTED_TYPE, "SUBMITTED");
41  
42      /**
43       * The RUNNING type
44       */
45      public static final int RUNNING_TYPE = 1;
46  
47      /**
48       * The instance of the RUNNING type
49       */
50      public static final JobStatusType RUNNING = new JobStatusType(RUNNING_TYPE, "RUNNING");
51  
52      /**
53       * The CANCELLED type
54       */
55      public static final int CANCELLED_TYPE = 2;
56  
57      /**
58       * The instance of the CANCELLED type
59       */
60      public static final JobStatusType CANCELLED = new JobStatusType(CANCELLED_TYPE, "CANCELLED");
61  
62      /**
63       * The FAILED type
64       */
65      public static final int FAILED_TYPE = 3;
66  
67      /**
68       * The instance of the FAILED type
69       */
70      public static final JobStatusType FAILED = new JobStatusType(FAILED_TYPE, "FAILED");
71  
72      /**
73       * The DONE type
74       */
75      public static final int DONE_TYPE = 4;
76  
77      /**
78       * The instance of the DONE type
79       */
80      public static final JobStatusType DONE = new JobStatusType(DONE_TYPE, "DONE");
81  
82      /**
83       * Field _memberTable
84       */
85      private static java.util.Hashtable _memberTable = init();
86  
87      /**
88       * Field type
89       */
90      private int type = -1;
91  
92      /**
93       * Field stringValue
94       */
95      private java.lang.String stringValue = null;
96  
97  
98        //----------------/
99       //- Constructors -/
100     //----------------/
101 
102     private JobStatusType(int type, java.lang.String value) 
103      {
104         super();
105         this.type = type;
106         this.stringValue = value;
107     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.types.JobStatusType(int, java.lang.String)
108 
109 
110       //-----------/
111      //- Methods -/
112     //-----------/
113 
114     /**
115      * Method enumerate
116      * 
117      * Returns an enumeration of all possible instances of
118      * JobStatusType
119      * 
120      * @return Enumeration
121      */
122     public static java.util.Enumeration enumerate()
123     {
124         return _memberTable.elements();
125     } //-- java.util.Enumeration enumerate() 
126 
127     /**
128      * Method getType
129      * 
130      * Returns the type of this JobStatusType
131      * 
132      * @return int
133      */
134     public int getType()
135     {
136         return this.type;
137     } //-- int getType() 
138 
139     /**
140      * Method init
141      * 
142      * 
143      * 
144      * @return Hashtable
145      */
146     private static java.util.Hashtable init()
147     {
148         Hashtable members = new Hashtable();
149         members.put("SUBMITTED", SUBMITTED);
150         members.put("RUNNING", RUNNING);
151         members.put("CANCELLED", CANCELLED);
152         members.put("FAILED", FAILED);
153         members.put("DONE", DONE);
154         return members;
155     } //-- java.util.Hashtable init() 
156 
157     /**
158      * Method readResolve
159      * 
160      *  will be called during deserialization to replace the
161      * deserialized object with the correct constant instance.
162      * <br/>
163      * 
164      * @return Object
165      */
166     private java.lang.Object readResolve()
167     {
168         return valueOf(this.stringValue);
169     } //-- java.lang.Object readResolve() 
170 
171     /**
172      * Method toString
173      * 
174      * Returns the String representation of this JobStatusType
175      * 
176      * @return String
177      */
178     public java.lang.String toString()
179     {
180         return this.stringValue;
181     } //-- java.lang.String toString() 
182 
183     /**
184      * Method valueOf
185      * 
186      * Returns a new JobStatusType based on the given String value.
187      * 
188      * @param string
189      * @return JobStatusType
190      */
191     public static fr.in2p3.jsaga.adaptor.schema.job.emulator.types.JobStatusType valueOf(java.lang.String string)
192     {
193         java.lang.Object obj = null;
194         if (string != null) obj = _memberTable.get(string);
195         if (obj == null) {
196             String err = "'" + string + "' is not a valid JobStatusType";
197             throw new IllegalArgumentException(err);
198         }
199         return (JobStatusType) obj;
200     } //-- fr.in2p3.jsaga.adaptor.schema.job.emulator.types.JobStatusType valueOf(java.lang.String) 
201 
202 }