| 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>Priority Class</b></em>', |
| 18 | * and utility methods for working with them. |
| 19 | * <!-- end-user-doc --> |
| 20 | * @see scheduler.configuration.ConfigurationPackage#getPriorityClass() |
| 21 | * @model |
| 22 | * @generated |
| 23 | */ |
| 24 | public enum PriorityClass implements Enumerator { |
| 25 | /** |
| 26 | * The '<em><b>LOWEST</b></em>' literal object. |
| 27 | * <!-- begin-user-doc --> |
| 28 | * <!-- end-user-doc --> |
| 29 | * @see #LOWEST_VALUE |
| 30 | * @generated |
| 31 | * @ordered |
| 32 | */ |
| 33 | LOWEST(0, "LOWEST", "LOWEST"), |
| 34 | |
| 35 | /** |
| 36 | * The '<em><b>LOW</b></em>' literal object. |
| 37 | * <!-- begin-user-doc --> |
| 38 | * <!-- end-user-doc --> |
| 39 | * @see #LOW_VALUE |
| 40 | * @generated |
| 41 | * @ordered |
| 42 | */ |
| 43 | LOW(1, "LOW", "LOW"), |
| 44 | |
| 45 | /** |
| 46 | * The '<em><b>AVERAGE</b></em>' literal object. |
| 47 | * <!-- begin-user-doc --> |
| 48 | * <!-- end-user-doc --> |
| 49 | * @see #AVERAGE_VALUE |
| 50 | * @generated |
| 51 | * @ordered |
| 52 | */ |
| 53 | AVERAGE(2, "AVERAGE", "AVERAGE"), |
| 54 | |
| 55 | /** |
| 56 | * The '<em><b>HIGH</b></em>' literal object. |
| 57 | * <!-- begin-user-doc --> |
| 58 | * <!-- end-user-doc --> |
| 59 | * @see #HIGH_VALUE |
| 60 | * @generated |
| 61 | * @ordered |
| 62 | */ |
| 63 | HIGH(3, "HIGH", "HIGH"), |
| 64 | |
| 65 | /** |
| 66 | * The '<em><b>HIGHEST</b></em>' literal object. |
| 67 | * <!-- begin-user-doc --> |
| 68 | * <!-- end-user-doc --> |
| 69 | * @see #HIGHEST_VALUE |
| 70 | * @generated |
| 71 | * @ordered |
| 72 | */ |
| 73 | HIGHEST(4, "HIGHEST", "HIGHEST"), |
| 74 | |
| 75 | /** |
| 76 | * The '<em><b>DEFAULT</b></em>' literal object. |
| 77 | * <!-- begin-user-doc --> |
| 78 | * <!-- end-user-doc --> |
| 79 | * @see #DEFAULT_VALUE |
| 80 | * @generated |
| 81 | * @ordered |
| 82 | */ |
| 83 | DEFAULT(5, "DEFAULT", "DEFAULT"); |
| 84 | |
| 85 | /** |
| 86 | * The '<em><b>LOWEST</b></em>' literal value. |
| 87 | * <!-- begin-user-doc --> |
| 88 | * <p> |
| 89 | * If the meaning of '<em><b>LOWEST</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 #LOWEST |
| 94 | * @model |
| 95 | * @generated |
| 96 | * @ordered |
| 97 | */ |
| 98 | public static final int LOWEST_VALUE = 0; |
| 99 | |
| 100 | /** |
| 101 | * The '<em><b>LOW</b></em>' literal value. |
| 102 | * <!-- begin-user-doc --> |
| 103 | * <p> |
| 104 | * If the meaning of '<em><b>LOW</b></em>' literal object isn't clear, |
| 105 | * there really should be more of a description here... |
| 106 | * </p> |
| 107 | * <!-- end-user-doc --> |
| 108 | * @see #LOW |
| 109 | * @model |
| 110 | * @generated |
| 111 | * @ordered |
| 112 | */ |
| 113 | public static final int LOW_VALUE = 1; |
| 114 | |
| 115 | /** |
| 116 | * The '<em><b>AVERAGE</b></em>' literal value. |
| 117 | * <!-- begin-user-doc --> |
| 118 | * <p> |
| 119 | * If the meaning of '<em><b>AVERAGE</b></em>' literal object isn't clear, |
| 120 | * there really should be more of a description here... |
| 121 | * </p> |
| 122 | * <!-- end-user-doc --> |
| 123 | * @see #AVERAGE |
| 124 | * @model |
| 125 | * @generated |
| 126 | * @ordered |
| 127 | */ |
| 128 | public static final int AVERAGE_VALUE = 2; |
| 129 | |
| 130 | /** |
| 131 | * The '<em><b>HIGH</b></em>' literal value. |
| 132 | * <!-- begin-user-doc --> |
| 133 | * <p> |
| 134 | * If the meaning of '<em><b>HIGH</b></em>' literal object isn't clear, |
| 135 | * there really should be more of a description here... |
| 136 | * </p> |
| 137 | * <!-- end-user-doc --> |
| 138 | * @see #HIGH |
| 139 | * @model |
| 140 | * @generated |
| 141 | * @ordered |
| 142 | */ |
| 143 | public static final int HIGH_VALUE = 3; |
| 144 | |
| 145 | /** |
| 146 | * The '<em><b>HIGHEST</b></em>' literal value. |
| 147 | * <!-- begin-user-doc --> |
| 148 | * <p> |
| 149 | * If the meaning of '<em><b>HIGHEST</b></em>' literal object isn't clear, |
| 150 | * there really should be more of a description here... |
| 151 | * </p> |
| 152 | * <!-- end-user-doc --> |
| 153 | * @see #HIGHEST |
| 154 | * @model |
| 155 | * @generated |
| 156 | * @ordered |
| 157 | */ |
| 158 | public static final int HIGHEST_VALUE = 4; |
| 159 | |
| 160 | /** |
| 161 | * The '<em><b>DEFAULT</b></em>' literal value. |
| 162 | * <!-- begin-user-doc --> |
| 163 | * <p> |
| 164 | * If the meaning of '<em><b>DEFAULT</b></em>' literal object isn't clear, |
| 165 | * there really should be more of a description here... |
| 166 | * </p> |
| 167 | * <!-- end-user-doc --> |
| 168 | * @see #DEFAULT |
| 169 | * @model |
| 170 | * @generated |
| 171 | * @ordered |
| 172 | */ |
| 173 | public static final int DEFAULT_VALUE = 5; |
| 174 | |
| 175 | /** |
| 176 | * An array of all the '<em><b>Priority Class</b></em>' enumerators. |
| 177 | * <!-- begin-user-doc --> |
| 178 | * <!-- end-user-doc --> |
| 179 | * @generated |
| 180 | */ |
| 181 | private static final PriorityClass[] VALUES_ARRAY = |
| 182 | new PriorityClass[] { |
| 183 | LOWEST, |
| 184 | LOW, |
| 185 | AVERAGE, |
| 186 | HIGH, |
| 187 | HIGHEST, |
| 188 | DEFAULT, |
| 189 | }; |
| 190 | |
| 191 | /** |
| 192 | * A public read-only list of all the '<em><b>Priority Class</b></em>' enumerators. |
| 193 | * <!-- begin-user-doc --> |
| 194 | * <!-- end-user-doc --> |
| 195 | * @generated |
| 196 | */ |
| 197 | public static final List<PriorityClass> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| 198 | |
| 199 | /** |
| 200 | * Returns the '<em><b>Priority Class</b></em>' literal with the specified literal value. |
| 201 | * <!-- begin-user-doc --> |
| 202 | * <!-- end-user-doc --> |
| 203 | * @generated |
| 204 | */ |
| 205 | public static PriorityClass get(String literal) { |
| 206 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| 207 | PriorityClass result = VALUES_ARRAY[i]; |
| 208 | if (result.toString().equals(literal)) { |
| 209 | return result; |
| 210 | } |
| 211 | } |
| 212 | return null; |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * Returns the '<em><b>Priority Class</b></em>' literal with the specified name. |
| 217 | * <!-- begin-user-doc --> |
| 218 | * <!-- end-user-doc --> |
| 219 | * @generated |
| 220 | */ |
| 221 | public static PriorityClass getByName(String name) { |
| 222 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| 223 | PriorityClass result = VALUES_ARRAY[i]; |
| 224 | if (result.getName().equals(name)) { |
| 225 | return result; |
| 226 | } |
| 227 | } |
| 228 | return null; |
| 229 | } |
| 230 | |
| 231 | /** |
| 232 | * Returns the '<em><b>Priority Class</b></em>' literal with the specified integer value. |
| 233 | * <!-- begin-user-doc --> |
| 234 | * <!-- end-user-doc --> |
| 235 | * @generated |
| 236 | */ |
| 237 | public static PriorityClass get(int value) { |
| 238 | switch (value) { |
| 239 | case LOWEST_VALUE: return LOWEST; |
| 240 | case LOW_VALUE: return LOW; |
| 241 | case AVERAGE_VALUE: return AVERAGE; |
| 242 | case HIGH_VALUE: return HIGH; |
| 243 | case HIGHEST_VALUE: return HIGHEST; |
| 244 | case DEFAULT_VALUE: return DEFAULT; |
| 245 | } |
| 246 | return null; |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * <!-- begin-user-doc --> |
| 251 | * <!-- end-user-doc --> |
| 252 | * @generated |
| 253 | */ |
| 254 | private final int value; |
| 255 | |
| 256 | /** |
| 257 | * <!-- begin-user-doc --> |
| 258 | * <!-- end-user-doc --> |
| 259 | * @generated |
| 260 | */ |
| 261 | private final String name; |
| 262 | |
| 263 | /** |
| 264 | * <!-- begin-user-doc --> |
| 265 | * <!-- end-user-doc --> |
| 266 | * @generated |
| 267 | */ |
| 268 | private final String literal; |
| 269 | |
| 270 | /** |
| 271 | * Only this class can construct instances. |
| 272 | * <!-- begin-user-doc --> |
| 273 | * <!-- end-user-doc --> |
| 274 | * @generated |
| 275 | */ |
| 276 | private PriorityClass(int value, String name, String literal) { |
| 277 | this.value = value; |
| 278 | this.name = name; |
| 279 | this.literal = literal; |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * <!-- begin-user-doc --> |
| 284 | * <!-- end-user-doc --> |
| 285 | * @generated |
| 286 | */ |
| 287 | public int getValue() { |
| 288 | return value; |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * <!-- begin-user-doc --> |
| 293 | * <!-- end-user-doc --> |
| 294 | * @generated |
| 295 | */ |
| 296 | public String getName() { |
| 297 | return name; |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * <!-- begin-user-doc --> |
| 302 | * <!-- end-user-doc --> |
| 303 | * @generated |
| 304 | */ |
| 305 | public String getLiteral() { |
| 306 | return literal; |
| 307 | } |
| 308 | |
| 309 | /** |
| 310 | * Returns the literal value of the enumerator, which is its string representation. |
| 311 | * <!-- begin-user-doc --> |
| 312 | * <!-- end-user-doc --> |
| 313 | * @generated |
| 314 | */ |
| 315 | @Override |
| 316 | public String toString() { |
| 317 | return literal; |
| 318 | } |
| 319 | |
| 320 | } //PriorityClass |