1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.stoex; |
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>Compare Operations</b></em>', |
18 | * and utility methods for working with them. |
19 | * <!-- end-user-doc --> |
20 | * @see de.uka.ipd.sdq.stoex.StoexPackage#getCompareOperations() |
21 | * @model |
22 | * @generated |
23 | */ |
24 | public enum CompareOperations implements Enumerator { |
25 | /** |
26 | * The '<em><b>GREATER</b></em>' literal object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @see #GREATER_VALUE |
30 | * @generated |
31 | * @ordered |
32 | */ |
33 | GREATER(0, "GREATER", "GREATER"), |
34 | |
35 | /** |
36 | * The '<em><b>EQUALS</b></em>' literal object. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #EQUALS_VALUE |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | EQUALS(1, "EQUALS", "EQUALS"), |
44 | |
45 | /** |
46 | * The '<em><b>LESS</b></em>' literal object. |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @see #LESS_VALUE |
50 | * @generated |
51 | * @ordered |
52 | */ |
53 | LESS(2, "LESS", "LESS"), |
54 | |
55 | /** |
56 | * The '<em><b>NOTEQUAL</b></em>' literal object. |
57 | * <!-- begin-user-doc --> |
58 | * <!-- end-user-doc --> |
59 | * @see #NOTEQUAL_VALUE |
60 | * @generated |
61 | * @ordered |
62 | */ |
63 | NOTEQUAL(3, "NOTEQUAL", "NOTEQUAL"), |
64 | |
65 | /** |
66 | * The '<em><b>LESSEQUAL</b></em>' literal object. |
67 | * <!-- begin-user-doc --> |
68 | * <!-- end-user-doc --> |
69 | * @see #LESSEQUAL_VALUE |
70 | * @generated |
71 | * @ordered |
72 | */ |
73 | LESSEQUAL(4, "LESSEQUAL", "LESSEQUAL"), |
74 | |
75 | /** |
76 | * The '<em><b>GREATEREQUAL</b></em>' literal object. |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @see #GREATEREQUAL_VALUE |
80 | * @generated |
81 | * @ordered |
82 | */ |
83 | GREATEREQUAL(5, "GREATEREQUAL", "GREATEREQUAL"); |
84 | |
85 | /** |
86 | * <!-- begin-user-doc --> |
87 | * <!-- end-user-doc --> |
88 | * @generated |
89 | */ |
90 | public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe"; |
91 | |
92 | /** |
93 | * The '<em><b>GREATER</b></em>' literal value. |
94 | * <!-- begin-user-doc --> |
95 | * <p> |
96 | * If the meaning of '<em><b>GREATER</b></em>' literal object isn't clear, |
97 | * there really should be more of a description here... |
98 | * </p> |
99 | * <!-- end-user-doc --> |
100 | * @see #GREATER |
101 | * @model |
102 | * @generated |
103 | * @ordered |
104 | */ |
105 | public static final int GREATER_VALUE = 0; |
106 | |
107 | /** |
108 | * The '<em><b>EQUALS</b></em>' literal value. |
109 | * <!-- begin-user-doc --> |
110 | * <p> |
111 | * If the meaning of '<em><b>EQUALS</b></em>' literal object isn't clear, |
112 | * there really should be more of a description here... |
113 | * </p> |
114 | * <!-- end-user-doc --> |
115 | * @see #EQUALS |
116 | * @model |
117 | * @generated |
118 | * @ordered |
119 | */ |
120 | public static final int EQUALS_VALUE = 1; |
121 | |
122 | /** |
123 | * The '<em><b>LESS</b></em>' literal value. |
124 | * <!-- begin-user-doc --> |
125 | * <p> |
126 | * If the meaning of '<em><b>LESS</b></em>' literal object isn't clear, |
127 | * there really should be more of a description here... |
128 | * </p> |
129 | * <!-- end-user-doc --> |
130 | * @see #LESS |
131 | * @model |
132 | * @generated |
133 | * @ordered |
134 | */ |
135 | public static final int LESS_VALUE = 2; |
136 | |
137 | /** |
138 | * The '<em><b>NOTEQUAL</b></em>' literal value. |
139 | * <!-- begin-user-doc --> |
140 | * <p> |
141 | * If the meaning of '<em><b>NOTEQUAL</b></em>' literal object isn't clear, |
142 | * there really should be more of a description here... |
143 | * </p> |
144 | * <!-- end-user-doc --> |
145 | * @see #NOTEQUAL |
146 | * @model |
147 | * @generated |
148 | * @ordered |
149 | */ |
150 | public static final int NOTEQUAL_VALUE = 3; |
151 | |
152 | /** |
153 | * The '<em><b>LESSEQUAL</b></em>' literal value. |
154 | * <!-- begin-user-doc --> |
155 | * <p> |
156 | * If the meaning of '<em><b>LESSEQUAL</b></em>' literal object isn't clear, |
157 | * there really should be more of a description here... |
158 | * </p> |
159 | * <!-- end-user-doc --> |
160 | * @see #LESSEQUAL |
161 | * @model |
162 | * @generated |
163 | * @ordered |
164 | */ |
165 | public static final int LESSEQUAL_VALUE = 4; |
166 | |
167 | /** |
168 | * The '<em><b>GREATEREQUAL</b></em>' literal value. |
169 | * <!-- begin-user-doc --> |
170 | * <p> |
171 | * If the meaning of '<em><b>GREATEREQUAL</b></em>' literal object isn't clear, |
172 | * there really should be more of a description here... |
173 | * </p> |
174 | * <!-- end-user-doc --> |
175 | * @see #GREATEREQUAL |
176 | * @model |
177 | * @generated |
178 | * @ordered |
179 | */ |
180 | public static final int GREATEREQUAL_VALUE = 5; |
181 | |
182 | /** |
183 | * An array of all the '<em><b>Compare Operations</b></em>' enumerators. |
184 | * <!-- begin-user-doc --> |
185 | * <!-- end-user-doc --> |
186 | * @generated |
187 | */ |
188 | private static final CompareOperations[] VALUES_ARRAY = |
189 | new CompareOperations[] { |
190 | GREATER, |
191 | EQUALS, |
192 | LESS, |
193 | NOTEQUAL, |
194 | LESSEQUAL, |
195 | GREATEREQUAL, |
196 | }; |
197 | |
198 | /** |
199 | * A public read-only list of all the '<em><b>Compare Operations</b></em>' enumerators. |
200 | * <!-- begin-user-doc --> |
201 | * <!-- end-user-doc --> |
202 | * @generated |
203 | */ |
204 | public static final List<CompareOperations> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
205 | |
206 | /** |
207 | * Returns the '<em><b>Compare Operations</b></em>' literal with the specified literal value. |
208 | * <!-- begin-user-doc --> |
209 | * <!-- end-user-doc --> |
210 | * @generated |
211 | */ |
212 | public static CompareOperations get(String literal) { |
213 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
214 | CompareOperations result = VALUES_ARRAY[i]; |
215 | if (result.toString().equals(literal)) { |
216 | return result; |
217 | } |
218 | } |
219 | return null; |
220 | } |
221 | |
222 | /** |
223 | * Returns the '<em><b>Compare Operations</b></em>' literal with the specified name. |
224 | * <!-- begin-user-doc --> |
225 | * <!-- end-user-doc --> |
226 | * @generated |
227 | */ |
228 | public static CompareOperations getByName(String name) { |
229 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
230 | CompareOperations result = VALUES_ARRAY[i]; |
231 | if (result.getName().equals(name)) { |
232 | return result; |
233 | } |
234 | } |
235 | return null; |
236 | } |
237 | |
238 | /** |
239 | * Returns the '<em><b>Compare Operations</b></em>' literal with the specified integer value. |
240 | * <!-- begin-user-doc --> |
241 | * <!-- end-user-doc --> |
242 | * @generated |
243 | */ |
244 | public static CompareOperations get(int value) { |
245 | switch (value) { |
246 | case GREATER_VALUE: return GREATER; |
247 | case EQUALS_VALUE: return EQUALS; |
248 | case LESS_VALUE: return LESS; |
249 | case NOTEQUAL_VALUE: return NOTEQUAL; |
250 | case LESSEQUAL_VALUE: return LESSEQUAL; |
251 | case GREATEREQUAL_VALUE: return GREATEREQUAL; |
252 | } |
253 | return null; |
254 | } |
255 | |
256 | /** |
257 | * <!-- begin-user-doc --> |
258 | * <!-- end-user-doc --> |
259 | * @generated |
260 | */ |
261 | private final int value; |
262 | |
263 | /** |
264 | * <!-- begin-user-doc --> |
265 | * <!-- end-user-doc --> |
266 | * @generated |
267 | */ |
268 | private final String name; |
269 | |
270 | /** |
271 | * <!-- begin-user-doc --> |
272 | * <!-- end-user-doc --> |
273 | * @generated |
274 | */ |
275 | private final String literal; |
276 | |
277 | /** |
278 | * Only this class can construct instances. |
279 | * <!-- begin-user-doc --> |
280 | * <!-- end-user-doc --> |
281 | * @generated |
282 | */ |
283 | private CompareOperations(int value, String name, String literal) { |
284 | this.value = value; |
285 | this.name = name; |
286 | this.literal = literal; |
287 | } |
288 | |
289 | /** |
290 | * <!-- begin-user-doc --> |
291 | * <!-- end-user-doc --> |
292 | * @generated |
293 | */ |
294 | public int getValue() { |
295 | return value; |
296 | } |
297 | |
298 | /** |
299 | * <!-- begin-user-doc --> |
300 | * <!-- end-user-doc --> |
301 | * @generated |
302 | */ |
303 | public String getName() { |
304 | return name; |
305 | } |
306 | |
307 | /** |
308 | * <!-- begin-user-doc --> |
309 | * <!-- end-user-doc --> |
310 | * @generated |
311 | */ |
312 | public String getLiteral() { |
313 | return literal; |
314 | } |
315 | |
316 | /** |
317 | * Returns the literal value of the enumerator, which is its string representation. |
318 | * <!-- begin-user-doc --> |
319 | * <!-- end-user-doc --> |
320 | * @generated |
321 | */ |
322 | @Override |
323 | public String toString() { |
324 | return literal; |
325 | } |
326 | |
327 | } //CompareOperations |