1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType; |
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>Enum Relation Semantics</b></em>', |
18 | * and utility methods for working with them. |
19 | * <!-- end-user-doc --> |
20 | * @see de.uka.ipd.sdq.dsexplore.qml.contracttype.QMLContractType.QMLContractTypePackage#getEnumRelationSemantics() |
21 | * @model |
22 | * @generated |
23 | */ |
24 | public enum EnumRelationSemantics implements Enumerator { |
25 | /** |
26 | * The '<em><b>Decreasing</b></em>' literal object. |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @see #DECREASING_VALUE |
30 | * @generated |
31 | * @ordered |
32 | */ |
33 | DECREASING(0, "decreasing", "decreasing"), |
34 | |
35 | /** |
36 | * The '<em><b>Increasing</b></em>' literal object. |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @see #INCREASING_VALUE |
40 | * @generated |
41 | * @ordered |
42 | */ |
43 | INCREASING(1, "increasing", "increasing"); |
44 | |
45 | /** |
46 | * The '<em><b>Decreasing</b></em>' literal value. |
47 | * <!-- begin-user-doc --> |
48 | * <p> |
49 | * If the meaning of '<em><b>Decreasing</b></em>' literal object isn't clear, |
50 | * there really should be more of a description here... |
51 | * </p> |
52 | * <!-- end-user-doc --> |
53 | * @see #DECREASING |
54 | * @model name="decreasing" |
55 | * @generated |
56 | * @ordered |
57 | */ |
58 | public static final int DECREASING_VALUE = 0; |
59 | |
60 | /** |
61 | * The '<em><b>Increasing</b></em>' literal value. |
62 | * <!-- begin-user-doc --> |
63 | * <p> |
64 | * If the meaning of '<em><b>Increasing</b></em>' literal object isn't clear, |
65 | * there really should be more of a description here... |
66 | * </p> |
67 | * <!-- end-user-doc --> |
68 | * @see #INCREASING |
69 | * @model name="increasing" |
70 | * @generated |
71 | * @ordered |
72 | */ |
73 | public static final int INCREASING_VALUE = 1; |
74 | |
75 | /** |
76 | * An array of all the '<em><b>Enum Relation Semantics</b></em>' enumerators. |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @generated |
80 | */ |
81 | private static final EnumRelationSemantics[] VALUES_ARRAY = |
82 | new EnumRelationSemantics[] { |
83 | DECREASING, |
84 | INCREASING, |
85 | }; |
86 | |
87 | /** |
88 | * A public read-only list of all the '<em><b>Enum Relation Semantics</b></em>' enumerators. |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | public static final List<EnumRelationSemantics> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
94 | |
95 | /** |
96 | * Returns the '<em><b>Enum Relation Semantics</b></em>' literal with the specified literal value. |
97 | * <!-- begin-user-doc --> |
98 | * <!-- end-user-doc --> |
99 | * @generated |
100 | */ |
101 | public static EnumRelationSemantics get(String literal) { |
102 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
103 | EnumRelationSemantics result = VALUES_ARRAY[i]; |
104 | if (result.toString().equals(literal)) { |
105 | return result; |
106 | } |
107 | } |
108 | return null; |
109 | } |
110 | |
111 | /** |
112 | * Returns the '<em><b>Enum Relation Semantics</b></em>' literal with the specified name. |
113 | * <!-- begin-user-doc --> |
114 | * <!-- end-user-doc --> |
115 | * @generated |
116 | */ |
117 | public static EnumRelationSemantics getByName(String name) { |
118 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
119 | EnumRelationSemantics result = VALUES_ARRAY[i]; |
120 | if (result.getName().equals(name)) { |
121 | return result; |
122 | } |
123 | } |
124 | return null; |
125 | } |
126 | |
127 | /** |
128 | * Returns the '<em><b>Enum Relation Semantics</b></em>' literal with the specified integer value. |
129 | * <!-- begin-user-doc --> |
130 | * <!-- end-user-doc --> |
131 | * @generated |
132 | */ |
133 | public static EnumRelationSemantics get(int value) { |
134 | switch (value) { |
135 | case DECREASING_VALUE: return DECREASING; |
136 | case INCREASING_VALUE: return INCREASING; |
137 | } |
138 | return null; |
139 | } |
140 | |
141 | /** |
142 | * <!-- begin-user-doc --> |
143 | * <!-- end-user-doc --> |
144 | * @generated |
145 | */ |
146 | private final int value; |
147 | |
148 | /** |
149 | * <!-- begin-user-doc --> |
150 | * <!-- end-user-doc --> |
151 | * @generated |
152 | */ |
153 | private final String name; |
154 | |
155 | /** |
156 | * <!-- begin-user-doc --> |
157 | * <!-- end-user-doc --> |
158 | * @generated |
159 | */ |
160 | private final String literal; |
161 | |
162 | /** |
163 | * Only this class can construct instances. |
164 | * <!-- begin-user-doc --> |
165 | * <!-- end-user-doc --> |
166 | * @generated |
167 | */ |
168 | private EnumRelationSemantics(int value, String name, String literal) { |
169 | this.value = value; |
170 | this.name = name; |
171 | this.literal = literal; |
172 | } |
173 | |
174 | /** |
175 | * <!-- begin-user-doc --> |
176 | * <!-- end-user-doc --> |
177 | * @generated |
178 | */ |
179 | public int getValue() { |
180 | return value; |
181 | } |
182 | |
183 | /** |
184 | * <!-- begin-user-doc --> |
185 | * <!-- end-user-doc --> |
186 | * @generated |
187 | */ |
188 | public String getName() { |
189 | return name; |
190 | } |
191 | |
192 | /** |
193 | * <!-- begin-user-doc --> |
194 | * <!-- end-user-doc --> |
195 | * @generated |
196 | */ |
197 | public String getLiteral() { |
198 | return literal; |
199 | } |
200 | |
201 | /** |
202 | * Returns the literal value of the enumerator, which is its string representation. |
203 | * <!-- begin-user-doc --> |
204 | * <!-- end-user-doc --> |
205 | * @generated |
206 | */ |
207 | @Override |
208 | public String toString() { |
209 | return literal; |
210 | } |
211 | |
212 | } //EnumRelationSemantics |