1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.parameter; |
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>Variable Characterisation Type</b></em>', |
17 | * and utility methods for working with them. |
18 | * <!-- end-user-doc --> |
19 | * <!-- begin-model-doc --> |
20 | * The variable characterisation types determine the set of available meta-informations on variables. Possible values are STRUCTURE, NUMBER_OF_ELEMENTS, VALUE, BYTESIZE, and TYPE. |
21 | * <!-- end-model-doc --> |
22 | * @see de.uka.ipd.sdq.pcm.parameter.ParameterPackage#getVariableCharacterisationType() |
23 | * @model |
24 | * @generated |
25 | */ |
26 | public enum VariableCharacterisationType implements Enumerator { |
27 | /** |
28 | * The '<em><b>STRUCTURE</b></em>' literal object. |
29 | * <!-- begin-user-doc --> |
30 | * <!-- end-user-doc --> |
31 | * @see #STRUCTURE_VALUE |
32 | * @generated |
33 | * @ordered |
34 | */ |
35 | STRUCTURE(0, "STRUCTURE", "STRUCTURE"), |
36 | |
37 | /** |
38 | * The '<em><b>NUMBER OF ELEMENTS</b></em>' literal object. |
39 | * <!-- begin-user-doc --> |
40 | * <!-- end-user-doc --> |
41 | * @see #NUMBER_OF_ELEMENTS_VALUE |
42 | * @generated |
43 | * @ordered |
44 | */ |
45 | NUMBER_OF_ELEMENTS(1, "NUMBER_OF_ELEMENTS", "NUMBER_OF_ELEMENTS"), |
46 | |
47 | /** |
48 | * The '<em><b>VALUE</b></em>' literal object. |
49 | * <!-- begin-user-doc --> |
50 | * <!-- end-user-doc --> |
51 | * @see #VALUE_VALUE |
52 | * @generated |
53 | * @ordered |
54 | */ |
55 | VALUE(2, "VALUE", "VALUE"), |
56 | |
57 | /** |
58 | * The '<em><b>BYTESIZE</b></em>' literal object. |
59 | * <!-- begin-user-doc --> |
60 | * <!-- end-user-doc --> |
61 | * @see #BYTESIZE_VALUE |
62 | * @generated |
63 | * @ordered |
64 | */ |
65 | BYTESIZE(3, "BYTESIZE", "BYTESIZE"), |
66 | |
67 | /** |
68 | * The '<em><b>TYPE</b></em>' literal object. |
69 | * <!-- begin-user-doc --> |
70 | * <!-- end-user-doc --> |
71 | * @see #TYPE_VALUE |
72 | * @generated |
73 | * @ordered |
74 | */ |
75 | TYPE(4, "TYPE", "TYPE"); |
76 | |
77 | /** |
78 | * <!-- begin-user-doc --> |
79 | * <!-- end-user-doc --> |
80 | * @generated |
81 | */ |
82 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
83 | |
84 | /** |
85 | * The '<em><b>STRUCTURE</b></em>' literal value. |
86 | * <!-- begin-user-doc --> |
87 | * <!-- end-user-doc --> |
88 | * <!-- begin-model-doc --> |
89 | * The structure characterisation type is used to describe the structure of the data. With structure we refer to performance relevant properties of data like for example whether an array is sorted, a tree is balanced, a collection is indexed, and so on.... The allowed set of value of the structure characterisation has to be specified by the component developer for a particular component. |
90 | * <!-- end-model-doc --> |
91 | * @see #STRUCTURE |
92 | * @model |
93 | * @generated |
94 | * @ordered |
95 | */ |
96 | public static final int STRUCTURE_VALUE = 0; |
97 | |
98 | /** |
99 | * The '<em><b>NUMBER OF ELEMENTS</b></em>' literal value. |
100 | * <!-- begin-user-doc --> |
101 | * <!-- end-user-doc --> |
102 | * <!-- begin-model-doc --> |
103 | * The number of elements of a collection data type describe the amount of data objects contained in the collection. |
104 | * <!-- end-model-doc --> |
105 | * @see #NUMBER_OF_ELEMENTS |
106 | * @model |
107 | * @generated |
108 | * @ordered |
109 | */ |
110 | public static final int NUMBER_OF_ELEMENTS_VALUE = 1; |
111 | |
112 | /** |
113 | * The '<em><b>VALUE</b></em>' literal value. |
114 | * <!-- begin-user-doc --> |
115 | * <!-- end-user-doc --> |
116 | * <!-- begin-model-doc --> |
117 | * The value characterisation can be used to specify the actual value of a parameter. It is only available for parameters having a primitive type. The value characterisation should be used with care as it increased the complexity of the resulting analysis model significantly. It should be only used in performance-critical cases. |
118 | * <!-- end-model-doc --> |
119 | * @see #VALUE |
120 | * @model |
121 | * @generated |
122 | * @ordered |
123 | */ |
124 | public static final int VALUE_VALUE = 2; |
125 | |
126 | /** |
127 | * The '<em><b>BYTESIZE</b></em>' literal value. |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * <!-- begin-model-doc --> |
131 | * The bytesize characterisation specifies the memory footprint of a data object. |
132 | * <!-- end-model-doc --> |
133 | * @see #BYTESIZE |
134 | * @model |
135 | * @generated |
136 | * @ordered |
137 | */ |
138 | public static final int BYTESIZE_VALUE = 3; |
139 | |
140 | /** |
141 | * The '<em><b>TYPE</b></em>' literal value. |
142 | * <!-- begin-user-doc --> |
143 | * <!-- end-user-doc --> |
144 | * <!-- begin-model-doc --> |
145 | * The type characterisation specifies the actual data type of polymorphic data objects in cases where the actual type has an impact on performance. For example in a shape drawing application the actual shape of a geometric object has an impact on the performance as drawing a circle is much more time consuming than drawing a simple line. |
146 | * <!-- end-model-doc --> |
147 | * @see #TYPE |
148 | * @model |
149 | * @generated |
150 | * @ordered |
151 | */ |
152 | public static final int TYPE_VALUE = 4; |
153 | |
154 | /** |
155 | * An array of all the '<em><b>Variable Characterisation Type</b></em>' enumerators. |
156 | * <!-- begin-user-doc --> |
157 | * <!-- end-user-doc --> |
158 | * @generated |
159 | */ |
160 | private static final VariableCharacterisationType[] VALUES_ARRAY = |
161 | new VariableCharacterisationType[] { |
162 | STRUCTURE, |
163 | NUMBER_OF_ELEMENTS, |
164 | VALUE, |
165 | BYTESIZE, |
166 | TYPE, |
167 | }; |
168 | |
169 | /** |
170 | * A public read-only list of all the '<em><b>Variable Characterisation Type</b></em>' enumerators. |
171 | * <!-- begin-user-doc --> |
172 | * <!-- end-user-doc --> |
173 | * @generated |
174 | */ |
175 | public static final List<VariableCharacterisationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
176 | |
177 | /** |
178 | * Returns the '<em><b>Variable Characterisation Type</b></em>' literal with the specified literal value. |
179 | * <!-- begin-user-doc --> |
180 | * <!-- end-user-doc --> |
181 | * @generated |
182 | */ |
183 | public static VariableCharacterisationType get(String literal) { |
184 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
185 | VariableCharacterisationType result = VALUES_ARRAY[i]; |
186 | if (result.toString().equals(literal)) { |
187 | return result; |
188 | } |
189 | } |
190 | return null; |
191 | } |
192 | |
193 | /** |
194 | * Returns the '<em><b>Variable Characterisation Type</b></em>' literal with the specified name. |
195 | * <!-- begin-user-doc --> |
196 | * <!-- end-user-doc --> |
197 | * @generated |
198 | */ |
199 | public static VariableCharacterisationType getByName(String name) { |
200 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
201 | VariableCharacterisationType result = VALUES_ARRAY[i]; |
202 | if (result.getName().equals(name)) { |
203 | return result; |
204 | } |
205 | } |
206 | return null; |
207 | } |
208 | |
209 | /** |
210 | * Returns the '<em><b>Variable Characterisation Type</b></em>' literal with the specified integer value. |
211 | * <!-- begin-user-doc --> |
212 | * <!-- end-user-doc --> |
213 | * @generated |
214 | */ |
215 | public static VariableCharacterisationType get(int value) { |
216 | switch (value) { |
217 | case STRUCTURE_VALUE: return STRUCTURE; |
218 | case NUMBER_OF_ELEMENTS_VALUE: return NUMBER_OF_ELEMENTS; |
219 | case VALUE_VALUE: return VALUE; |
220 | case BYTESIZE_VALUE: return BYTESIZE; |
221 | case TYPE_VALUE: return TYPE; |
222 | } |
223 | return null; |
224 | } |
225 | |
226 | /** |
227 | * <!-- begin-user-doc --> |
228 | * <!-- end-user-doc --> |
229 | * @generated |
230 | */ |
231 | private final int value; |
232 | |
233 | /** |
234 | * <!-- begin-user-doc --> |
235 | * <!-- end-user-doc --> |
236 | * @generated |
237 | */ |
238 | private final String name; |
239 | |
240 | /** |
241 | * <!-- begin-user-doc --> |
242 | * <!-- end-user-doc --> |
243 | * @generated |
244 | */ |
245 | private final String literal; |
246 | |
247 | /** |
248 | * Only this class can construct instances. |
249 | * <!-- begin-user-doc --> |
250 | * <!-- end-user-doc --> |
251 | * @generated |
252 | */ |
253 | private VariableCharacterisationType(int value, String name, String literal) { |
254 | this.value = value; |
255 | this.name = name; |
256 | this.literal = literal; |
257 | } |
258 | |
259 | /** |
260 | * <!-- begin-user-doc --> |
261 | * <!-- end-user-doc --> |
262 | * @generated |
263 | */ |
264 | public int getValue() { |
265 | return value; |
266 | } |
267 | |
268 | /** |
269 | * <!-- begin-user-doc --> |
270 | * <!-- end-user-doc --> |
271 | * @generated |
272 | */ |
273 | public String getName() { |
274 | return name; |
275 | } |
276 | |
277 | /** |
278 | * <!-- begin-user-doc --> |
279 | * <!-- end-user-doc --> |
280 | * @generated |
281 | */ |
282 | public String getLiteral() { |
283 | return literal; |
284 | } |
285 | |
286 | /** |
287 | * Returns the literal value of the enumerator, which is its string representation. |
288 | * <!-- begin-user-doc --> |
289 | * <!-- end-user-doc --> |
290 | * @generated |
291 | */ |
292 | @Override |
293 | public String toString() { |
294 | return literal; |
295 | } |
296 | |
297 | } //VariableCharacterisationType |