1
2
3
4
5
6
7
8 package fr.in2p3.jsaga.adaptor.schema.job.emulator.types;
9
10
11
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
22
23
24
25 public class JobStatusType implements java.io.Serializable {
26
27
28
29
30
31
32
33
34
35 public static final int SUBMITTED_TYPE = 0;
36
37
38
39
40 public static final JobStatusType SUBMITTED = new JobStatusType(SUBMITTED_TYPE, "SUBMITTED");
41
42
43
44
45 public static final int RUNNING_TYPE = 1;
46
47
48
49
50 public static final JobStatusType RUNNING = new JobStatusType(RUNNING_TYPE, "RUNNING");
51
52
53
54
55 public static final int CANCELLED_TYPE = 2;
56
57
58
59
60 public static final JobStatusType CANCELLED = new JobStatusType(CANCELLED_TYPE, "CANCELLED");
61
62
63
64
65 public static final int FAILED_TYPE = 3;
66
67
68
69
70 public static final JobStatusType FAILED = new JobStatusType(FAILED_TYPE, "FAILED");
71
72
73
74
75 public static final int DONE_TYPE = 4;
76
77
78
79
80 public static final JobStatusType DONE = new JobStatusType(DONE_TYPE, "DONE");
81
82
83
84
85 private static java.util.Hashtable _memberTable = init();
86
87
88
89
90 private int type = -1;
91
92
93
94
95 private java.lang.String stringValue = null;
96
97
98
99
100
101
102 private JobStatusType(int type, java.lang.String value)
103 {
104 super();
105 this.type = type;
106 this.stringValue = value;
107 }
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122 public static java.util.Enumeration enumerate()
123 {
124 return _memberTable.elements();
125 }
126
127
128
129
130
131
132
133
134 public int getType()
135 {
136 return this.type;
137 }
138
139
140
141
142
143
144
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 }
156
157
158
159
160
161
162
163
164
165
166 private java.lang.Object readResolve()
167 {
168 return valueOf(this.stringValue);
169 }
170
171
172
173
174
175
176
177
178 public java.lang.String toString()
179 {
180 return this.stringValue;
181 }
182
183
184
185
186
187
188
189
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 }
201
202 }