/** */ package hu.bme.mit.inf.dslreasoner.alloyLanguage; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.emf.common.util.Enumerator; /** * * A representation of the literals of the enumeration 'ALS Numeric Operator', * and utility methods for working with them. * * @see hu.bme.mit.inf.dslreasoner.alloyLanguage.AlloyLanguagePackage#getALSNumericOperator() * @model * @generated */ public enum ALSNumericOperator implements Enumerator { /** * The 'Plus' literal object. * * * @see #PLUS_VALUE * @generated * @ordered */ PLUS(0, "plus", "plus"), /** * The 'Sub' literal object. * * * @see #SUB_VALUE * @generated * @ordered */ SUB(1, "sub", "sub"), /** * The 'Mul' literal object. * * * @see #MUL_VALUE * @generated * @ordered */ MUL(2, "mul", "mul"), /** * The 'Rem' literal object. * * * @see #REM_VALUE * @generated * @ordered */ REM(3, "rem", "rem"), /** * The 'Div' literal object. * * * @see #DIV_VALUE * @generated * @ordered */ DIV(4, "div", "div"); /** * The 'Plus' literal value. * *

* If the meaning of 'Plus' literal object isn't clear, * there really should be more of a description here... *

* * @see #PLUS * @model name="plus" * @generated * @ordered */ public static final int PLUS_VALUE = 0; /** * The 'Sub' literal value. * *

* If the meaning of 'Sub' literal object isn't clear, * there really should be more of a description here... *

* * @see #SUB * @model name="sub" * @generated * @ordered */ public static final int SUB_VALUE = 1; /** * The 'Mul' literal value. * *

* If the meaning of 'Mul' literal object isn't clear, * there really should be more of a description here... *

* * @see #MUL * @model name="mul" * @generated * @ordered */ public static final int MUL_VALUE = 2; /** * The 'Rem' literal value. * *

* If the meaning of 'Rem' literal object isn't clear, * there really should be more of a description here... *

* * @see #REM * @model name="rem" * @generated * @ordered */ public static final int REM_VALUE = 3; /** * The 'Div' literal value. * *

* If the meaning of 'Div' literal object isn't clear, * there really should be more of a description here... *

* * @see #DIV * @model name="div" * @generated * @ordered */ public static final int DIV_VALUE = 4; /** * An array of all the 'ALS Numeric Operator' enumerators. * * * @generated */ private static final ALSNumericOperator[] VALUES_ARRAY = new ALSNumericOperator[] { PLUS, SUB, MUL, REM, DIV, }; /** * A public read-only list of all the 'ALS Numeric Operator' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'ALS Numeric Operator' literal with the specified literal value. * * * @param literal the literal. * @return the matching enumerator or null. * @generated */ public static ALSNumericOperator get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ALSNumericOperator result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'ALS Numeric Operator' literal with the specified name. * * * @param name the name. * @return the matching enumerator or null. * @generated */ public static ALSNumericOperator getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { ALSNumericOperator result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'ALS Numeric Operator' literal with the specified integer value. * * * @param value the integer value. * @return the matching enumerator or null. * @generated */ public static ALSNumericOperator get(int value) { switch (value) { case PLUS_VALUE: return PLUS; case SUB_VALUE: return SUB; case MUL_VALUE: return MUL; case REM_VALUE: return REM; case DIV_VALUE: return DIV; } return null; } /** * * * @generated */ private final int value; /** * * * @generated */ private final String name; /** * * * @generated */ private final String literal; /** * Only this class can construct instances. * * * @generated */ private ALSNumericOperator(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * * * @generated */ public int getValue() { return value; } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * * * @generated */ @Override public String toString() { return literal; } } //ALSNumericOperator