1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package LqnCore; |
8 | |
9 | import java.util.Arrays; |
10 | import java.util.Collections; |
11 | import java.util.List; |
12 | |
13 | import org.eclipse.emf.common.util.Enumerator; |
14 | |
15 | /** |
16 | * <!-- begin-user-doc --> |
17 | * A representation of the literals of the enumeration '<em><b>Scheduling Type</b></em>', |
18 | * and utility methods for working with them. |
19 | * <!-- end-user-doc --> |
20 | * @see LqnCore.LqnCorePackage#getSchedulingType() |
21 | * @model extendedMetaData="name='SchedulingType'" |
22 | * @generated |
23 | */ |
24 | public enum SchedulingType implements Enumerator { |
25 | /** |
26 | * The '<em><b>Fcfs</b></em>' literal object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @see #FCFS_VALUE |
30 | * @generated |
31 | * @ordered |
32 | */ |
33 | FCFS(0, "fcfs", "fcfs"), |
34 | |
35 | /** |
36 | * The '<em><b>Ps</b></em>' literal object. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #PS_VALUE |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | PS(1, "ps", "ps"), |
44 | |
45 | /** |
46 | * The '<em><b>Pp</b></em>' literal object. |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @see #PP_VALUE |
50 | * @generated |
51 | * @ordered |
52 | */ |
53 | PP(2, "pp", "pp"), |
54 | |
55 | /** |
56 | * The '<em><b>Rand</b></em>' literal object. |
57 | * <!-- begin-user-doc --> |
58 | * <!-- end-user-doc --> |
59 | * @see #RAND_VALUE |
60 | * @generated |
61 | * @ordered |
62 | */ |
63 | RAND(3, "rand", "rand"), |
64 | |
65 | /** |
66 | * The '<em><b>Hol</b></em>' literal object. |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @see #HOL_VALUE |
70 | * @generated |
71 | * @ordered |
72 | */ |
73 | HOL(4, "hol", "hol"), |
74 | |
75 | /** |
76 | * The '<em><b>Ps Hol</b></em>' literal object. |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @see #PS_HOL_VALUE |
80 | * @generated |
81 | * @ordered |
82 | */ |
83 | PS_HOL(5, "psHol", "ps-hol"), |
84 | |
85 | /** |
86 | * The '<em><b>Ps Pp</b></em>' literal object. |
87 | * <!-- begin-user-doc --> |
88 | * <!-- end-user-doc --> |
89 | * @see #PS_PP_VALUE |
90 | * @generated |
91 | * @ordered |
92 | */ |
93 | PS_PP(6, "psPp", "ps-pp"), |
94 | |
95 | /** |
96 | * @generated This would appear if the latest LQN model would be read in. |
97 | * However, I did not succeed in recreating the models automatically, so I have done it manually. |
98 | */ |
99 | INF(7,"inf","inf"); |
100 | |
101 | /** |
102 | * The '<em><b>Fcfs</b></em>' literal value. |
103 | * <!-- begin-user-doc --> |
104 | * <p> |
105 | * If the meaning of '<em><b>Fcfs</b></em>' literal object isn't clear, |
106 | * there really should be more of a description here... |
107 | * </p> |
108 | * <!-- end-user-doc --> |
109 | * @see #FCFS |
110 | * @model name="fcfs" |
111 | * @generated |
112 | * @ordered |
113 | */ |
114 | public static final int FCFS_VALUE = 0; |
115 | |
116 | /** |
117 | * The '<em><b>Ps</b></em>' literal value. |
118 | * <!-- begin-user-doc --> |
119 | * <p> |
120 | * If the meaning of '<em><b>Ps</b></em>' literal object isn't clear, |
121 | * there really should be more of a description here... |
122 | * </p> |
123 | * <!-- end-user-doc --> |
124 | * @see #PS |
125 | * @model name="ps" |
126 | * @generated |
127 | * @ordered |
128 | */ |
129 | public static final int PS_VALUE = 1; |
130 | |
131 | /** |
132 | * The '<em><b>Pp</b></em>' literal value. |
133 | * <!-- begin-user-doc --> |
134 | * <p> |
135 | * If the meaning of '<em><b>Pp</b></em>' literal object isn't clear, |
136 | * there really should be more of a description here... |
137 | * </p> |
138 | * <!-- end-user-doc --> |
139 | * @see #PP |
140 | * @model name="pp" |
141 | * @generated |
142 | * @ordered |
143 | */ |
144 | public static final int PP_VALUE = 2; |
145 | |
146 | /** |
147 | * The '<em><b>Rand</b></em>' literal value. |
148 | * <!-- begin-user-doc --> |
149 | * <p> |
150 | * If the meaning of '<em><b>Rand</b></em>' literal object isn't clear, |
151 | * there really should be more of a description here... |
152 | * </p> |
153 | * <!-- end-user-doc --> |
154 | * @see #RAND |
155 | * @model name="rand" |
156 | * @generated |
157 | * @ordered |
158 | */ |
159 | public static final int RAND_VALUE = 3; |
160 | |
161 | /** |
162 | * The '<em><b>Hol</b></em>' literal value. |
163 | * <!-- begin-user-doc --> |
164 | * <p> |
165 | * If the meaning of '<em><b>Hol</b></em>' literal object isn't clear, |
166 | * there really should be more of a description here... |
167 | * </p> |
168 | * <!-- end-user-doc --> |
169 | * @see #HOL |
170 | * @model name="hol" |
171 | * @generated |
172 | * @ordered |
173 | */ |
174 | public static final int HOL_VALUE = 4; |
175 | |
176 | /** |
177 | * The '<em><b>Ps Hol</b></em>' literal value. |
178 | * <!-- begin-user-doc --> |
179 | * <p> |
180 | * If the meaning of '<em><b>Ps Hol</b></em>' literal object isn't clear, |
181 | * there really should be more of a description here... |
182 | * </p> |
183 | * <!-- end-user-doc --> |
184 | * @see #PS_HOL |
185 | * @model name="psHol" literal="ps-hol" |
186 | * @generated |
187 | * @ordered |
188 | */ |
189 | public static final int PS_HOL_VALUE = 5; |
190 | |
191 | /** |
192 | * The '<em><b>Ps Pp</b></em>' literal value. |
193 | * <!-- begin-user-doc --> |
194 | * <p> |
195 | * If the meaning of '<em><b>Ps Pp</b></em>' literal object isn't clear, |
196 | * there really should be more of a description here... |
197 | * </p> |
198 | * <!-- end-user-doc --> |
199 | * @see #PS_PP |
200 | * @model name="psPp" literal="ps-pp" |
201 | * @generated |
202 | * @ordered |
203 | */ |
204 | public static final int PS_PP_VALUE = 6; |
205 | |
206 | public static final int INF_VALUE = 7; |
207 | |
208 | /** |
209 | * An array of all the '<em><b>Scheduling Type</b></em>' enumerators. |
210 | * <!-- begin-user-doc --> |
211 | * <!-- end-user-doc --> |
212 | * @generated |
213 | */ |
214 | private static final SchedulingType[] VALUES_ARRAY = |
215 | new SchedulingType[] { |
216 | FCFS, |
217 | PS, |
218 | PP, |
219 | RAND, |
220 | HOL, |
221 | PS_HOL, |
222 | PS_PP, |
223 | INF |
224 | }; |
225 | |
226 | /** |
227 | * A public read-only list of all the '<em><b>Scheduling Type</b></em>' enumerators. |
228 | * <!-- begin-user-doc --> |
229 | * <!-- end-user-doc --> |
230 | * @generated |
231 | */ |
232 | public static final List<SchedulingType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
233 | |
234 | /** |
235 | * Returns the '<em><b>Scheduling Type</b></em>' literal with the specified literal value. |
236 | * <!-- begin-user-doc --> |
237 | * <!-- end-user-doc --> |
238 | * @generated |
239 | */ |
240 | public static SchedulingType get(String literal) { |
241 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
242 | SchedulingType result = VALUES_ARRAY[i]; |
243 | if (result.toString().equals(literal)) { |
244 | return result; |
245 | } |
246 | } |
247 | return null; |
248 | } |
249 | |
250 | /** |
251 | * Returns the '<em><b>Scheduling Type</b></em>' literal with the specified name. |
252 | * <!-- begin-user-doc --> |
253 | * <!-- end-user-doc --> |
254 | * @generated |
255 | */ |
256 | public static SchedulingType getByName(String name) { |
257 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
258 | SchedulingType result = VALUES_ARRAY[i]; |
259 | if (result.getName().equals(name)) { |
260 | return result; |
261 | } |
262 | } |
263 | return null; |
264 | } |
265 | |
266 | /** |
267 | * Returns the '<em><b>Scheduling Type</b></em>' literal with the specified integer value. |
268 | * <!-- begin-user-doc --> |
269 | * <!-- end-user-doc --> |
270 | * @generated |
271 | */ |
272 | public static SchedulingType get(int value) { |
273 | switch (value) { |
274 | case FCFS_VALUE: return FCFS; |
275 | case PS_VALUE: return PS; |
276 | case PP_VALUE: return PP; |
277 | case RAND_VALUE: return RAND; |
278 | case HOL_VALUE: return HOL; |
279 | case PS_HOL_VALUE: return PS_HOL; |
280 | case PS_PP_VALUE: return PS_PP; |
281 | case INF_VALUE: return INF; |
282 | } |
283 | return null; |
284 | } |
285 | |
286 | /** |
287 | * <!-- begin-user-doc --> |
288 | * <!-- end-user-doc --> |
289 | * @generated |
290 | */ |
291 | private final int value; |
292 | |
293 | /** |
294 | * <!-- begin-user-doc --> |
295 | * <!-- end-user-doc --> |
296 | * @generated |
297 | */ |
298 | private final String name; |
299 | |
300 | /** |
301 | * <!-- begin-user-doc --> |
302 | * <!-- end-user-doc --> |
303 | * @generated |
304 | */ |
305 | private final String literal; |
306 | |
307 | /** |
308 | * Only this class can construct instances. |
309 | * <!-- begin-user-doc --> |
310 | * <!-- end-user-doc --> |
311 | * @generated |
312 | */ |
313 | private SchedulingType(int value, String name, String literal) { |
314 | this.value = value; |
315 | this.name = name; |
316 | this.literal = literal; |
317 | } |
318 | |
319 | /** |
320 | * <!-- begin-user-doc --> |
321 | * <!-- end-user-doc --> |
322 | * @generated |
323 | */ |
324 | public int getValue() { |
325 | return value; |
326 | } |
327 | |
328 | /** |
329 | * <!-- begin-user-doc --> |
330 | * <!-- end-user-doc --> |
331 | * @generated |
332 | */ |
333 | public String getName() { |
334 | return name; |
335 | } |
336 | |
337 | /** |
338 | * <!-- begin-user-doc --> |
339 | * <!-- end-user-doc --> |
340 | * @generated |
341 | */ |
342 | public String getLiteral() { |
343 | return literal; |
344 | } |
345 | |
346 | /** |
347 | * Returns the literal value of the enumerator, which is its string representation. |
348 | * <!-- begin-user-doc --> |
349 | * <!-- end-user-doc --> |
350 | * @generated |
351 | */ |
352 | @Override |
353 | public String toString() { |
354 | return literal; |
355 | } |
356 | |
357 | } //SchedulingType |