1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.repository; |
7 | |
8 | import java.util.Arrays; |
9 | import java.util.Collections; |
10 | import java.util.List; |
11 | |
12 | import org.eclipse.emf.common.util.Enumerator; |
13 | |
14 | /** |
15 | * <!-- begin-user-doc --> |
16 | * A representation of the literals of the enumeration '<em><b>Parameter Modifier</b></em>', |
17 | * and utility methods for working with them. |
18 | * <!-- end-user-doc --> |
19 | * <!-- begin-model-doc --> |
20 | * Parameter modifiers like known from C#. |
21 | * <!-- end-model-doc --> |
22 | * @see de.uka.ipd.sdq.pcm.repository.RepositoryPackage#getParameterModifier() |
23 | * @model |
24 | * @generated |
25 | */ |
26 | public enum ParameterModifier implements Enumerator { |
27 | /** |
28 | * The '<em><b>None</b></em>' literal object. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @see #NONE_VALUE |
32 | * @generated |
33 | * @ordered |
34 | */ |
35 | NONE(0, "none", "none"), |
36 | |
37 | /** |
38 | * The '<em><b>In</b></em>' literal object. |
39 | * <!-- begin-user-doc --> |
40 | * <!-- end-user-doc --> |
41 | * @see #IN_VALUE |
42 | * @generated |
43 | * @ordered |
44 | */ |
45 | IN(1, "in", "in"), |
46 | |
47 | /** |
48 | * The '<em><b>Out</b></em>' literal object. |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @see #OUT_VALUE |
52 | * @generated |
53 | * @ordered |
54 | */ |
55 | OUT(2, "out", "out"), |
56 | |
57 | /** |
58 | * The '<em><b>Inout</b></em>' literal object. |
59 | * <!-- begin-user-doc --> |
60 | * <!-- end-user-doc --> |
61 | * @see #INOUT_VALUE |
62 | * @generated |
63 | * @ordered |
64 | */ |
65 | INOUT(3, "inout", "inout"); |
66 | |
67 | /** |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @generated |
71 | */ |
72 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
73 | |
74 | /** |
75 | * The '<em><b>None</b></em>' literal value. |
76 | * <!-- begin-user-doc --> |
77 | * <!-- end-user-doc --> |
78 | * <!-- begin-model-doc --> |
79 | * Use this value if no parameter modifier shall be applied. |
80 | * <!-- end-model-doc --> |
81 | * @see #NONE |
82 | * @model name="none" |
83 | * @generated |
84 | * @ordered |
85 | */ |
86 | public static final int NONE_VALUE = 0; |
87 | |
88 | /** |
89 | * The '<em><b>In</b></em>' literal value. |
90 | * <!-- begin-user-doc --> |
91 | * <!-- end-user-doc --> |
92 | * <!-- begin-model-doc --> |
93 | * "in" according to C# semantics |
94 | * <!-- end-model-doc --> |
95 | * @see #IN |
96 | * @model name="in" |
97 | * @generated |
98 | * @ordered |
99 | */ |
100 | public static final int IN_VALUE = 1; |
101 | |
102 | /** |
103 | * The '<em><b>Out</b></em>' literal value. |
104 | * <!-- begin-user-doc --> |
105 | * <!-- end-user-doc --> |
106 | * <!-- begin-model-doc --> |
107 | * "out" according to C# semantics |
108 | * <!-- end-model-doc --> |
109 | * @see #OUT |
110 | * @model name="out" |
111 | * @generated |
112 | * @ordered |
113 | */ |
114 | public static final int OUT_VALUE = 2; |
115 | |
116 | /** |
117 | * The '<em><b>Inout</b></em>' literal value. |
118 | * <!-- begin-user-doc --> |
119 | * <!-- end-user-doc --> |
120 | * <!-- begin-model-doc --> |
121 | * ref" according to C# semantics |
122 | * <!-- end-model-doc --> |
123 | * @see #INOUT |
124 | * @model name="inout" |
125 | * @generated |
126 | * @ordered |
127 | */ |
128 | public static final int INOUT_VALUE = 3; |
129 | |
130 | /** |
131 | * An array of all the '<em><b>Parameter Modifier</b></em>' enumerators. |
132 | * <!-- begin-user-doc --> |
133 | * <!-- end-user-doc --> |
134 | * @generated |
135 | */ |
136 | private static final ParameterModifier[] VALUES_ARRAY = |
137 | new ParameterModifier[] { |
138 | NONE, |
139 | IN, |
140 | OUT, |
141 | INOUT, |
142 | }; |
143 | |
144 | /** |
145 | * A public read-only list of all the '<em><b>Parameter Modifier</b></em>' enumerators. |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | public static final List<ParameterModifier> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
151 | |
152 | /** |
153 | * Returns the '<em><b>Parameter Modifier</b></em>' literal with the specified literal value. |
154 | * <!-- begin-user-doc --> |
155 | * <!-- end-user-doc --> |
156 | * @generated |
157 | */ |
158 | public static ParameterModifier get(String literal) { |
159 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
160 | ParameterModifier result = VALUES_ARRAY[i]; |
161 | if (result.toString().equals(literal)) { |
162 | return result; |
163 | } |
164 | } |
165 | return null; |
166 | } |
167 | |
168 | /** |
169 | * Returns the '<em><b>Parameter Modifier</b></em>' literal with the specified name. |
170 | * <!-- begin-user-doc --> |
171 | * <!-- end-user-doc --> |
172 | * @generated |
173 | */ |
174 | public static ParameterModifier getByName(String name) { |
175 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
176 | ParameterModifier result = VALUES_ARRAY[i]; |
177 | if (result.getName().equals(name)) { |
178 | return result; |
179 | } |
180 | } |
181 | return null; |
182 | } |
183 | |
184 | /** |
185 | * Returns the '<em><b>Parameter Modifier</b></em>' literal with the specified integer value. |
186 | * <!-- begin-user-doc --> |
187 | * <!-- end-user-doc --> |
188 | * @generated |
189 | */ |
190 | public static ParameterModifier get(int value) { |
191 | switch (value) { |
192 | case NONE_VALUE: return NONE; |
193 | case IN_VALUE: return IN; |
194 | case OUT_VALUE: return OUT; |
195 | case INOUT_VALUE: return INOUT; |
196 | } |
197 | return null; |
198 | } |
199 | |
200 | /** |
201 | * <!-- begin-user-doc --> |
202 | * <!-- end-user-doc --> |
203 | * @generated |
204 | */ |
205 | private final int value; |
206 | |
207 | /** |
208 | * <!-- begin-user-doc --> |
209 | * <!-- end-user-doc --> |
210 | * @generated |
211 | */ |
212 | private final String name; |
213 | |
214 | /** |
215 | * <!-- begin-user-doc --> |
216 | * <!-- end-user-doc --> |
217 | * @generated |
218 | */ |
219 | private final String literal; |
220 | |
221 | /** |
222 | * Only this class can construct instances. |
223 | * <!-- begin-user-doc --> |
224 | * <!-- end-user-doc --> |
225 | * @generated |
226 | */ |
227 | private ParameterModifier(int value, String name, String literal) { |
228 | this.value = value; |
229 | this.name = name; |
230 | this.literal = literal; |
231 | } |
232 | |
233 | /** |
234 | * <!-- begin-user-doc --> |
235 | * <!-- end-user-doc --> |
236 | * @generated |
237 | */ |
238 | public int getValue() { |
239 | return value; |
240 | } |
241 | |
242 | /** |
243 | * <!-- begin-user-doc --> |
244 | * <!-- end-user-doc --> |
245 | * @generated |
246 | */ |
247 | public String getName() { |
248 | return name; |
249 | } |
250 | |
251 | /** |
252 | * <!-- begin-user-doc --> |
253 | * <!-- end-user-doc --> |
254 | * @generated |
255 | */ |
256 | public String getLiteral() { |
257 | return literal; |
258 | } |
259 | |
260 | /** |
261 | * Returns the literal value of the enumerator, which is its string representation. |
262 | * <!-- begin-user-doc --> |
263 | * <!-- end-user-doc --> |
264 | * @generated |
265 | */ |
266 | @Override |
267 | public String toString() { |
268 | return literal; |
269 | } |
270 | |
271 | } //ParameterModifier |