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