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>Product Operations</b></em>', |
18 | * and utility methods for working with them. |
19 | * <!-- end-user-doc --> |
20 | * @see de.uka.ipd.sdq.stoex.StoexPackage#getProductOperations() |
21 | * @model |
22 | * @generated |
23 | */ |
24 | public enum ProductOperations implements Enumerator { |
25 | /** |
26 | * The '<em><b>MULT</b></em>' literal object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @see #MULT_VALUE |
30 | * @generated |
31 | * @ordered |
32 | */ |
33 | MULT(0, "MULT", "MULT"), |
34 | |
35 | /** |
36 | * The '<em><b>DIV</b></em>' literal object. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #DIV_VALUE |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | DIV(1, "DIV", "DIV"), |
44 | |
45 | /** |
46 | * The '<em><b>MOD</b></em>' literal object. |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @see #MOD_VALUE |
50 | * @generated |
51 | * @ordered |
52 | */ |
53 | MOD(2, "MOD", "MOD"); |
54 | |
55 | /** |
56 | * <!-- begin-user-doc --> |
57 | * <!-- end-user-doc --> |
58 | * @generated |
59 | */ |
60 | public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe"; |
61 | |
62 | /** |
63 | * The '<em><b>MULT</b></em>' literal value. |
64 | * <!-- begin-user-doc --> |
65 | * <p> |
66 | * If the meaning of '<em><b>MULT</b></em>' literal object isn't clear, |
67 | * there really should be more of a description here... |
68 | * </p> |
69 | * <!-- end-user-doc --> |
70 | * @see #MULT |
71 | * @model |
72 | * @generated |
73 | * @ordered |
74 | */ |
75 | public static final int MULT_VALUE = 0; |
76 | |
77 | /** |
78 | * The '<em><b>DIV</b></em>' literal value. |
79 | * <!-- begin-user-doc --> |
80 | * <p> |
81 | * If the meaning of '<em><b>DIV</b></em>' literal object isn't clear, |
82 | * there really should be more of a description here... |
83 | * </p> |
84 | * <!-- end-user-doc --> |
85 | * @see #DIV |
86 | * @model |
87 | * @generated |
88 | * @ordered |
89 | */ |
90 | public static final int DIV_VALUE = 1; |
91 | |
92 | /** |
93 | * The '<em><b>MOD</b></em>' literal value. |
94 | * <!-- begin-user-doc --> |
95 | * <p> |
96 | * If the meaning of '<em><b>MOD</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 #MOD |
101 | * @model |
102 | * @generated |
103 | * @ordered |
104 | */ |
105 | public static final int MOD_VALUE = 2; |
106 | |
107 | /** |
108 | * An array of all the '<em><b>Product Operations</b></em>' enumerators. |
109 | * <!-- begin-user-doc --> |
110 | * <!-- end-user-doc --> |
111 | * @generated |
112 | */ |
113 | private static final ProductOperations[] VALUES_ARRAY = |
114 | new ProductOperations[] { |
115 | MULT, |
116 | DIV, |
117 | MOD, |
118 | }; |
119 | |
120 | /** |
121 | * A public read-only list of all the '<em><b>Product Operations</b></em>' enumerators. |
122 | * <!-- begin-user-doc --> |
123 | * <!-- end-user-doc --> |
124 | * @generated |
125 | */ |
126 | public static final List<ProductOperations> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
127 | |
128 | /** |
129 | * Returns the '<em><b>Product Operations</b></em>' literal with the specified literal value. |
130 | * <!-- begin-user-doc --> |
131 | * <!-- end-user-doc --> |
132 | * @generated |
133 | */ |
134 | public static ProductOperations get(String literal) { |
135 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
136 | ProductOperations result = VALUES_ARRAY[i]; |
137 | if (result.toString().equals(literal)) { |
138 | return result; |
139 | } |
140 | } |
141 | return null; |
142 | } |
143 | |
144 | /** |
145 | * Returns the '<em><b>Product Operations</b></em>' literal with the specified name. |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | public static ProductOperations getByName(String name) { |
151 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
152 | ProductOperations result = VALUES_ARRAY[i]; |
153 | if (result.getName().equals(name)) { |
154 | return result; |
155 | } |
156 | } |
157 | return null; |
158 | } |
159 | |
160 | /** |
161 | * Returns the '<em><b>Product Operations</b></em>' literal with the specified integer value. |
162 | * <!-- begin-user-doc --> |
163 | * <!-- end-user-doc --> |
164 | * @generated |
165 | */ |
166 | public static ProductOperations get(int value) { |
167 | switch (value) { |
168 | case MULT_VALUE: return MULT; |
169 | case DIV_VALUE: return DIV; |
170 | case MOD_VALUE: return MOD; |
171 | } |
172 | return null; |
173 | } |
174 | |
175 | /** |
176 | * <!-- begin-user-doc --> |
177 | * <!-- end-user-doc --> |
178 | * @generated |
179 | */ |
180 | private final int value; |
181 | |
182 | /** |
183 | * <!-- begin-user-doc --> |
184 | * <!-- end-user-doc --> |
185 | * @generated |
186 | */ |
187 | private final String name; |
188 | |
189 | /** |
190 | * <!-- begin-user-doc --> |
191 | * <!-- end-user-doc --> |
192 | * @generated |
193 | */ |
194 | private final String literal; |
195 | |
196 | /** |
197 | * Only this class can construct instances. |
198 | * <!-- begin-user-doc --> |
199 | * <!-- end-user-doc --> |
200 | * @generated |
201 | */ |
202 | private ProductOperations(int value, String name, String literal) { |
203 | this.value = value; |
204 | this.name = name; |
205 | this.literal = literal; |
206 | } |
207 | |
208 | /** |
209 | * <!-- begin-user-doc --> |
210 | * <!-- end-user-doc --> |
211 | * @generated |
212 | */ |
213 | public int getValue() { |
214 | return value; |
215 | } |
216 | |
217 | /** |
218 | * <!-- begin-user-doc --> |
219 | * <!-- end-user-doc --> |
220 | * @generated |
221 | */ |
222 | public String getName() { |
223 | return name; |
224 | } |
225 | |
226 | /** |
227 | * <!-- begin-user-doc --> |
228 | * <!-- end-user-doc --> |
229 | * @generated |
230 | */ |
231 | public String getLiteral() { |
232 | return literal; |
233 | } |
234 | |
235 | /** |
236 | * Returns the literal value of the enumerator, which is its string representation. |
237 | * <!-- begin-user-doc --> |
238 | * <!-- end-user-doc --> |
239 | * @generated |
240 | */ |
241 | @Override |
242 | public String toString() { |
243 | return literal; |
244 | } |
245 | |
246 | } //ProductOperations |