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