root/org.axdt.axdoc/src/org/axdt/axdoc/model/AXEntryType.java @ 9a9ef10dfc3b0467e14e06261fda3654c5aced64

Revision 9a9ef10dfc3b0467e14e06261fda3654c5aced64, 7.7 KB (checked in by Martin Schnabel <mb0@…>, 16 months ago)

initial commit.
axdoc emf model with tests and asdoc parser.
(asdoc parsing is not 100% functional yet)

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