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