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