source: branches/xtext-MDT/org.modelica.xtext/src-gen/org/modelica/xtext/modelicaBase/ClassType.java @ 540

Last change on this file since 540 was 540, checked in by nasko, 15 years ago

Added subfolders/files of org.modelica.xtext

File size: 8.5 KB
Line 
1/**
2 * <copyright>
3 * </copyright>
4 *
5 */
6package org.modelica.xtext.modelicaBase;
7
8import java.util.Arrays;
9import java.util.Collections;
10import java.util.List;
11
12import org.eclipse.emf.common.util.Enumerator;
13
14/**
15 * <!-- begin-user-doc -->
16 * A representation of the literals of the enumeration '<em><b>Class Type</b></em>',
17 * and utility methods for working with them.
18 * <!-- end-user-doc -->
19 * @see org.modelica.xtext.modelicaBase.ModelicaBasePackage#getClassType()
20 * @model
21 * @generated
22 */
23public enum ClassType implements Enumerator
24{
25  /**
26   * The '<em><b>CLASS</b></em>' literal object.
27   * <!-- begin-user-doc -->
28   * <!-- end-user-doc -->
29   * @see #CLASS_VALUE
30   * @generated
31   * @ordered
32   */
33  CLASS(0, "CLASS", "class"),
34
35  /**
36   * The '<em><b>MODEL</b></em>' literal object.
37   * <!-- begin-user-doc -->
38   * <!-- end-user-doc -->
39   * @see #MODEL_VALUE
40   * @generated
41   * @ordered
42   */
43  MODEL(1, "MODEL", "model"),
44
45  /**
46   * The '<em><b>RECORD</b></em>' literal object.
47   * <!-- begin-user-doc -->
48   * <!-- end-user-doc -->
49   * @see #RECORD_VALUE
50   * @generated
51   * @ordered
52   */
53  RECORD(2, "RECORD", "record"),
54
55  /**
56   * The '<em><b>BLOCK</b></em>' literal object.
57   * <!-- begin-user-doc -->
58   * <!-- end-user-doc -->
59   * @see #BLOCK_VALUE
60   * @generated
61   * @ordered
62   */
63  BLOCK(3, "BLOCK", "block"),
64
65  /**
66   * The '<em><b>CONNECTOR</b></em>' literal object.
67   * <!-- begin-user-doc -->
68   * <!-- end-user-doc -->
69   * @see #CONNECTOR_VALUE
70   * @generated
71   * @ordered
72   */
73  CONNECTOR(4, "CONNECTOR", "connector"),
74
75  /**
76   * The '<em><b>TYPE</b></em>' literal object.
77   * <!-- begin-user-doc -->
78   * <!-- end-user-doc -->
79   * @see #TYPE_VALUE
80   * @generated
81   * @ordered
82   */
83  TYPE(5, "TYPE", "type"),
84
85  /**
86   * The '<em><b>PACKAGE</b></em>' literal object.
87   * <!-- begin-user-doc -->
88   * <!-- end-user-doc -->
89   * @see #PACKAGE_VALUE
90   * @generated
91   * @ordered
92   */
93  PACKAGE(6, "PACKAGE", "package"),
94
95  /**
96   * The '<em><b>FUNCTION</b></em>' literal object.
97   * <!-- begin-user-doc -->
98   * <!-- end-user-doc -->
99   * @see #FUNCTION_VALUE
100   * @generated
101   * @ordered
102   */
103  FUNCTION(7, "FUNCTION", "function");
104
105  /**
106   * The '<em><b>CLASS</b></em>' literal value.
107   * <!-- begin-user-doc -->
108   * <p>
109   * If the meaning of '<em><b>CLASS</b></em>' literal object isn't clear,
110   * there really should be more of a description here...
111   * </p>
112   * <!-- end-user-doc -->
113   * @see #CLASS
114   * @model literal="class"
115   * @generated
116   * @ordered
117   */
118  public static final int CLASS_VALUE = 0;
119
120  /**
121   * The '<em><b>MODEL</b></em>' literal value.
122   * <!-- begin-user-doc -->
123   * <p>
124   * If the meaning of '<em><b>MODEL</b></em>' literal object isn't clear,
125   * there really should be more of a description here...
126   * </p>
127   * <!-- end-user-doc -->
128   * @see #MODEL
129   * @model literal="model"
130   * @generated
131   * @ordered
132   */
133  public static final int MODEL_VALUE = 1;
134
135  /**
136   * The '<em><b>RECORD</b></em>' literal value.
137   * <!-- begin-user-doc -->
138   * <p>
139   * If the meaning of '<em><b>RECORD</b></em>' literal object isn't clear,
140   * there really should be more of a description here...
141   * </p>
142   * <!-- end-user-doc -->
143   * @see #RECORD
144   * @model literal="record"
145   * @generated
146   * @ordered
147   */
148  public static final int RECORD_VALUE = 2;
149
150  /**
151   * The '<em><b>BLOCK</b></em>' literal value.
152   * <!-- begin-user-doc -->
153   * <p>
154   * If the meaning of '<em><b>BLOCK</b></em>' literal object isn't clear,
155   * there really should be more of a description here...
156   * </p>
157   * <!-- end-user-doc -->
158   * @see #BLOCK
159   * @model literal="block"
160   * @generated
161   * @ordered
162   */
163  public static final int BLOCK_VALUE = 3;
164
165  /**
166   * The '<em><b>CONNECTOR</b></em>' literal value.
167   * <!-- begin-user-doc -->
168   * <p>
169   * If the meaning of '<em><b>CONNECTOR</b></em>' literal object isn't clear,
170   * there really should be more of a description here...
171   * </p>
172   * <!-- end-user-doc -->
173   * @see #CONNECTOR
174   * @model literal="connector"
175   * @generated
176   * @ordered
177   */
178  public static final int CONNECTOR_VALUE = 4;
179
180  /**
181   * The '<em><b>TYPE</b></em>' literal value.
182   * <!-- begin-user-doc -->
183   * <p>
184   * If the meaning of '<em><b>TYPE</b></em>' literal object isn't clear,
185   * there really should be more of a description here...
186   * </p>
187   * <!-- end-user-doc -->
188   * @see #TYPE
189   * @model literal="type"
190   * @generated
191   * @ordered
192   */
193  public static final int TYPE_VALUE = 5;
194
195  /**
196   * The '<em><b>PACKAGE</b></em>' literal value.
197   * <!-- begin-user-doc -->
198   * <p>
199   * If the meaning of '<em><b>PACKAGE</b></em>' literal object isn't clear,
200   * there really should be more of a description here...
201   * </p>
202   * <!-- end-user-doc -->
203   * @see #PACKAGE
204   * @model literal="package"
205   * @generated
206   * @ordered
207   */
208  public static final int PACKAGE_VALUE = 6;
209
210  /**
211   * The '<em><b>FUNCTION</b></em>' literal value.
212   * <!-- begin-user-doc -->
213   * <p>
214   * If the meaning of '<em><b>FUNCTION</b></em>' literal object isn't clear,
215   * there really should be more of a description here...
216   * </p>
217   * <!-- end-user-doc -->
218   * @see #FUNCTION
219   * @model literal="function"
220   * @generated
221   * @ordered
222   */
223  public static final int FUNCTION_VALUE = 7;
224
225  /**
226   * An array of all the '<em><b>Class Type</b></em>' enumerators.
227   * <!-- begin-user-doc -->
228   * <!-- end-user-doc -->
229   * @generated
230   */
231  private static final ClassType[] VALUES_ARRAY =
232    new ClassType[]
233    {
234      CLASS,
235      MODEL,
236      RECORD,
237      BLOCK,
238      CONNECTOR,
239      TYPE,
240      PACKAGE,
241      FUNCTION,
242    };
243
244  /**
245   * A public read-only list of all the '<em><b>Class Type</b></em>' enumerators.
246   * <!-- begin-user-doc -->
247   * <!-- end-user-doc -->
248   * @generated
249   */
250  public static final List<ClassType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
251
252  /**
253   * Returns the '<em><b>Class Type</b></em>' literal with the specified literal value.
254   * <!-- begin-user-doc -->
255   * <!-- end-user-doc -->
256   * @generated
257   */
258  public static ClassType get(String literal)
259  {
260    for (int i = 0; i < VALUES_ARRAY.length; ++i)
261    {
262      ClassType result = VALUES_ARRAY[i];
263      if (result.toString().equals(literal))
264      {
265        return result;
266      }
267    }
268    return null;
269  }
270
271  /**
272   * Returns the '<em><b>Class Type</b></em>' literal with the specified name.
273   * <!-- begin-user-doc -->
274   * <!-- end-user-doc -->
275   * @generated
276   */
277  public static ClassType getByName(String name)
278  {
279    for (int i = 0; i < VALUES_ARRAY.length; ++i)
280    {
281      ClassType result = VALUES_ARRAY[i];
282      if (result.getName().equals(name))
283      {
284        return result;
285      }
286    }
287    return null;
288  }
289
290  /**
291   * Returns the '<em><b>Class Type</b></em>' literal with the specified integer value.
292   * <!-- begin-user-doc -->
293   * <!-- end-user-doc -->
294   * @generated
295   */
296  public static ClassType get(int value)
297  {
298    switch (value)
299    {
300      case CLASS_VALUE: return CLASS;
301      case MODEL_VALUE: return MODEL;
302      case RECORD_VALUE: return RECORD;
303      case BLOCK_VALUE: return BLOCK;
304      case CONNECTOR_VALUE: return CONNECTOR;
305      case TYPE_VALUE: return TYPE;
306      case PACKAGE_VALUE: return PACKAGE;
307      case FUNCTION_VALUE: return FUNCTION;
308    }
309    return null;
310  }
311
312  /**
313   * <!-- begin-user-doc -->
314   * <!-- end-user-doc -->
315   * @generated
316   */
317  private final int value;
318
319  /**
320   * <!-- begin-user-doc -->
321   * <!-- end-user-doc -->
322   * @generated
323   */
324  private final String name;
325
326  /**
327   * <!-- begin-user-doc -->
328   * <!-- end-user-doc -->
329   * @generated
330   */
331  private final String literal;
332
333  /**
334   * Only this class can construct instances.
335   * <!-- begin-user-doc -->
336   * <!-- end-user-doc -->
337   * @generated
338   */
339  private ClassType(int value, String name, String literal)
340  {
341    this.value = value;
342    this.name = name;
343    this.literal = literal;
344  }
345
346  /**
347   * <!-- begin-user-doc -->
348   * <!-- end-user-doc -->
349   * @generated
350   */
351  public int getValue()
352  {
353    return value;
354  }
355
356  /**
357   * <!-- begin-user-doc -->
358   * <!-- end-user-doc -->
359   * @generated
360   */
361  public String getName()
362  {
363    return name;
364  }
365
366  /**
367   * <!-- begin-user-doc -->
368   * <!-- end-user-doc -->
369   * @generated
370   */
371  public String getLiteral()
372  {
373    return literal;
374  }
375
376  /**
377   * Returns the literal value of the enumerator, which is its string representation.
378   * <!-- begin-user-doc -->
379   * <!-- end-user-doc -->
380   * @generated
381   */
382  @Override
383  public String toString()
384  {
385    return literal;
386  }
387 
388} //ClassType
Note: See TracBrowser for help on using the repository browser.