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