| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.sensitivity; |
| 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>Double Offset Type</b></em>', |
| 18 | * and utility methods for working with them. |
| 19 | * <!-- end-user-doc --> |
| 20 | * <!-- begin-model-doc --> |
| 21 | * <p> |
| 22 | * Specifies the type of offset represented by a double value (val_off) that is connected to an original value (val_orig) |
| 23 | * to achieve a new result value (val_res): |
| 24 | * </p> |
| 25 | * <p> |
| 26 | * ADD: val_res = val_orig + val_off |
| 27 | * </p> |
| 28 | * <p> |
| 29 | * SUBTRACT: val_res = val_orig - val_off |
| 30 | * </p> |
| 31 | * <p> |
| 32 | * MULTIPLY: val_res = val_orig * val_off |
| 33 | * </p> |
| 34 | * <p> |
| 35 | * DIVIDE: val_res = val_orig / val_off |
| 36 | * </p> |
| 37 | * <!-- end-model-doc --> |
| 38 | * @see de.uka.ipd.sdq.sensitivity.SensitivityPackage#getDoubleOffsetType() |
| 39 | * @model |
| 40 | * @generated |
| 41 | */ |
| 42 | public enum DoubleOffsetType implements Enumerator { |
| 43 | /** |
| 44 | * The '<em><b>ADD</b></em>' literal object. |
| 45 | * <!-- begin-user-doc --> |
| 46 | * <!-- end-user-doc --> |
| 47 | * @see #ADD_VALUE |
| 48 | * @generated |
| 49 | * @ordered |
| 50 | */ |
| 51 | ADD(0, "ADD", "ADD"), |
| 52 | |
| 53 | /** |
| 54 | * The '<em><b>SUBTRACT</b></em>' literal object. |
| 55 | * <!-- begin-user-doc --> |
| 56 | * <!-- end-user-doc --> |
| 57 | * @see #SUBTRACT_VALUE |
| 58 | * @generated |
| 59 | * @ordered |
| 60 | */ |
| 61 | SUBTRACT(1, "SUBTRACT", "SUBTRACT"), |
| 62 | |
| 63 | /** |
| 64 | * The '<em><b>MULTIPLY</b></em>' literal object. |
| 65 | * <!-- begin-user-doc --> |
| 66 | * <!-- end-user-doc --> |
| 67 | * @see #MULTIPLY_VALUE |
| 68 | * @generated |
| 69 | * @ordered |
| 70 | */ |
| 71 | MULTIPLY(2, "MULTIPLY", "MULTIPLY"), |
| 72 | |
| 73 | /** |
| 74 | * The '<em><b>DIVIDE</b></em>' literal object. |
| 75 | * <!-- begin-user-doc --> |
| 76 | * <!-- end-user-doc --> |
| 77 | * @see #DIVIDE_VALUE |
| 78 | * @generated |
| 79 | * @ordered |
| 80 | */ |
| 81 | DIVIDE(3, "DIVIDE", "DIVIDE"); |
| 82 | |
| 83 | /** |
| 84 | * The '<em><b>ADD</b></em>' literal value. |
| 85 | * <!-- begin-user-doc --> |
| 86 | * <p> |
| 87 | * If the meaning of '<em><b>ADD</b></em>' literal object isn't clear, |
| 88 | * there really should be more of a description here... |
| 89 | * </p> |
| 90 | * <!-- end-user-doc --> |
| 91 | * @see #ADD |
| 92 | * @model |
| 93 | * @generated |
| 94 | * @ordered |
| 95 | */ |
| 96 | public static final int ADD_VALUE = 0; |
| 97 | |
| 98 | /** |
| 99 | * The '<em><b>SUBTRACT</b></em>' literal value. |
| 100 | * <!-- begin-user-doc --> |
| 101 | * <p> |
| 102 | * If the meaning of '<em><b>SUBTRACT</b></em>' literal object isn't clear, |
| 103 | * there really should be more of a description here... |
| 104 | * </p> |
| 105 | * <!-- end-user-doc --> |
| 106 | * @see #SUBTRACT |
| 107 | * @model |
| 108 | * @generated |
| 109 | * @ordered |
| 110 | */ |
| 111 | public static final int SUBTRACT_VALUE = 1; |
| 112 | |
| 113 | /** |
| 114 | * The '<em><b>MULTIPLY</b></em>' literal value. |
| 115 | * <!-- begin-user-doc --> |
| 116 | * <p> |
| 117 | * If the meaning of '<em><b>MULTIPLY</b></em>' literal object isn't clear, |
| 118 | * there really should be more of a description here... |
| 119 | * </p> |
| 120 | * <!-- end-user-doc --> |
| 121 | * @see #MULTIPLY |
| 122 | * @model |
| 123 | * @generated |
| 124 | * @ordered |
| 125 | */ |
| 126 | public static final int MULTIPLY_VALUE = 2; |
| 127 | |
| 128 | /** |
| 129 | * The '<em><b>DIVIDE</b></em>' literal value. |
| 130 | * <!-- begin-user-doc --> |
| 131 | * <p> |
| 132 | * If the meaning of '<em><b>DIVIDE</b></em>' literal object isn't clear, |
| 133 | * there really should be more of a description here... |
| 134 | * </p> |
| 135 | * <!-- end-user-doc --> |
| 136 | * @see #DIVIDE |
| 137 | * @model |
| 138 | * @generated |
| 139 | * @ordered |
| 140 | */ |
| 141 | public static final int DIVIDE_VALUE = 3; |
| 142 | |
| 143 | /** |
| 144 | * An array of all the '<em><b>Double Offset Type</b></em>' enumerators. |
| 145 | * <!-- begin-user-doc --> |
| 146 | * <!-- end-user-doc --> |
| 147 | * @generated |
| 148 | */ |
| 149 | private static final DoubleOffsetType[] VALUES_ARRAY = |
| 150 | new DoubleOffsetType[] { |
| 151 | ADD, |
| 152 | SUBTRACT, |
| 153 | MULTIPLY, |
| 154 | DIVIDE, |
| 155 | }; |
| 156 | |
| 157 | /** |
| 158 | * A public read-only list of all the '<em><b>Double Offset Type</b></em>' enumerators. |
| 159 | * <!-- begin-user-doc --> |
| 160 | * <!-- end-user-doc --> |
| 161 | * @generated |
| 162 | */ |
| 163 | public static final List<DoubleOffsetType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| 164 | |
| 165 | /** |
| 166 | * Returns the '<em><b>Double Offset Type</b></em>' literal with the specified literal value. |
| 167 | * <!-- begin-user-doc --> |
| 168 | * <!-- end-user-doc --> |
| 169 | * @generated |
| 170 | */ |
| 171 | public static DoubleOffsetType get(String literal) { |
| 172 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| 173 | DoubleOffsetType result = VALUES_ARRAY[i]; |
| 174 | if (result.toString().equals(literal)) { |
| 175 | return result; |
| 176 | } |
| 177 | } |
| 178 | return null; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * Returns the '<em><b>Double Offset Type</b></em>' literal with the specified name. |
| 183 | * <!-- begin-user-doc --> |
| 184 | * <!-- end-user-doc --> |
| 185 | * @generated |
| 186 | */ |
| 187 | public static DoubleOffsetType getByName(String name) { |
| 188 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| 189 | DoubleOffsetType result = VALUES_ARRAY[i]; |
| 190 | if (result.getName().equals(name)) { |
| 191 | return result; |
| 192 | } |
| 193 | } |
| 194 | return null; |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Returns the '<em><b>Double Offset Type</b></em>' literal with the specified integer value. |
| 199 | * <!-- begin-user-doc --> |
| 200 | * <!-- end-user-doc --> |
| 201 | * @generated |
| 202 | */ |
| 203 | public static DoubleOffsetType get(int value) { |
| 204 | switch (value) { |
| 205 | case ADD_VALUE: return ADD; |
| 206 | case SUBTRACT_VALUE: return SUBTRACT; |
| 207 | case MULTIPLY_VALUE: return MULTIPLY; |
| 208 | case DIVIDE_VALUE: return DIVIDE; |
| 209 | } |
| 210 | return null; |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * <!-- begin-user-doc --> |
| 215 | * <!-- end-user-doc --> |
| 216 | * @generated |
| 217 | */ |
| 218 | private final int value; |
| 219 | |
| 220 | /** |
| 221 | * <!-- begin-user-doc --> |
| 222 | * <!-- end-user-doc --> |
| 223 | * @generated |
| 224 | */ |
| 225 | private final String name; |
| 226 | |
| 227 | /** |
| 228 | * <!-- begin-user-doc --> |
| 229 | * <!-- end-user-doc --> |
| 230 | * @generated |
| 231 | */ |
| 232 | private final String literal; |
| 233 | |
| 234 | /** |
| 235 | * Only this class can construct instances. |
| 236 | * <!-- begin-user-doc --> |
| 237 | * <!-- end-user-doc --> |
| 238 | * @generated |
| 239 | */ |
| 240 | private DoubleOffsetType(int value, String name, String literal) { |
| 241 | this.value = value; |
| 242 | this.name = name; |
| 243 | this.literal = literal; |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * <!-- begin-user-doc --> |
| 248 | * <!-- end-user-doc --> |
| 249 | * @generated |
| 250 | */ |
| 251 | public int getValue() { |
| 252 | return value; |
| 253 | } |
| 254 | |
| 255 | /** |
| 256 | * <!-- begin-user-doc --> |
| 257 | * <!-- end-user-doc --> |
| 258 | * @generated |
| 259 | */ |
| 260 | public String getName() { |
| 261 | return name; |
| 262 | } |
| 263 | |
| 264 | /** |
| 265 | * <!-- begin-user-doc --> |
| 266 | * <!-- end-user-doc --> |
| 267 | * @generated |
| 268 | */ |
| 269 | public String getLiteral() { |
| 270 | return literal; |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Returns the literal value of the enumerator, which is its string representation. |
| 275 | * <!-- begin-user-doc --> |
| 276 | * <!-- end-user-doc --> |
| 277 | * @generated |
| 278 | */ |
| 279 | @Override |
| 280 | public String toString() { |
| 281 | return literal; |
| 282 | } |
| 283 | |
| 284 | } //DoubleOffsetType |