/** * generated by Xtext 2.21.0 */ package org.eclipse.viatra.solver.language.solverLanguage; 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 'Binary Operator', * and utility methods for working with them. * * @see org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage#getBinaryOperator() * @model * @generated */ public enum BinaryOperator implements Enumerator { /** * The 'EQ' literal object. * * * @see #EQ_VALUE * @generated * @ordered */ EQ(0, "EQ", "EQ"), /** * The 'NOT EQ' literal object. * * * @see #NOT_EQ_VALUE * @generated * @ordered */ NOT_EQ(1, "NOT_EQ", "NOT_EQ"), /** * The 'LESS' literal object. * * * @see #LESS_VALUE * @generated * @ordered */ LESS(2, "LESS", "LESS"), /** * The 'LESS EQ' literal object. * * * @see #LESS_EQ_VALUE * @generated * @ordered */ LESS_EQ(3, "LESS_EQ", "LESS_EQ"), /** * The 'GREATER' literal object. * * * @see #GREATER_VALUE * @generated * @ordered */ GREATER(4, "GREATER", "GREATER"), /** * The 'GREATER EQ' literal object. * * * @see #GREATER_EQ_VALUE * @generated * @ordered */ GREATER_EQ(5, "GREATER_EQ", "GREATER_EQ"), /** * The 'IN' literal object. * * * @see #IN_VALUE * @generated * @ordered */ IN(6, "IN", "IN"), /** * The 'ADD' literal object. * * * @see #ADD_VALUE * @generated * @ordered */ ADD(7, "ADD", "ADD"), /** * The 'SUB' literal object. * * * @see #SUB_VALUE * @generated * @ordered */ SUB(8, "SUB", "SUB"), /** * The 'MUL' literal object. * * * @see #MUL_VALUE * @generated * @ordered */ MUL(9, "MUL", "MUL"), /** * The 'DIV' literal object. * * * @see #DIV_VALUE * @generated * @ordered */ DIV(10, "DIV", "DIV"), /** * The 'POW' literal object. * * * @see #POW_VALUE * @generated * @ordered */ POW(11, "POW", "POW"); /** * The 'EQ' literal value. * * * @see #EQ * @model * @generated * @ordered */ public static final int EQ_VALUE = 0; /** * The 'NOT EQ' literal value. * * * @see #NOT_EQ * @model * @generated * @ordered */ public static final int NOT_EQ_VALUE = 1; /** * The 'LESS' literal value. * * * @see #LESS * @model * @generated * @ordered */ public static final int LESS_VALUE = 2; /** * The 'LESS EQ' literal value. * * * @see #LESS_EQ * @model * @generated * @ordered */ public static final int LESS_EQ_VALUE = 3; /** * The 'GREATER' literal value. * * * @see #GREATER * @model * @generated * @ordered */ public static final int GREATER_VALUE = 4; /** * The 'GREATER EQ' literal value. * * * @see #GREATER_EQ * @model * @generated * @ordered */ public static final int GREATER_EQ_VALUE = 5; /** * The 'IN' literal value. * * * @see #IN * @model * @generated * @ordered */ public static final int IN_VALUE = 6; /** * The 'ADD' literal value. * * * @see #ADD * @model * @generated * @ordered */ public static final int ADD_VALUE = 7; /** * The 'SUB' literal value. * * * @see #SUB * @model * @generated * @ordered */ public static final int SUB_VALUE = 8; /** * The 'MUL' literal value. * * * @see #MUL * @model * @generated * @ordered */ public static final int MUL_VALUE = 9; /** * The 'DIV' literal value. * * * @see #DIV * @model * @generated * @ordered */ public static final int DIV_VALUE = 10; /** * The 'POW' literal value. * * * @see #POW * @model * @generated * @ordered */ public static final int POW_VALUE = 11; /** * An array of all the 'Binary Operator' enumerators. * * * @generated */ private static final BinaryOperator[] VALUES_ARRAY = new BinaryOperator[] { EQ, NOT_EQ, LESS, LESS_EQ, GREATER, GREATER_EQ, IN, ADD, SUB, MUL, DIV, POW, }; /** * A public read-only list of all the 'Binary Operator' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'Binary Operator' literal with the specified literal value. * * * @param literal the literal. * @return the matching enumerator or null. * @generated */ public static BinaryOperator get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { BinaryOperator result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Binary Operator' literal with the specified name. * * * @param name the name. * @return the matching enumerator or null. * @generated */ public static BinaryOperator getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { BinaryOperator result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Binary Operator' literal with the specified integer value. * * * @param value the integer value. * @return the matching enumerator or null. * @generated */ public static BinaryOperator get(int value) { switch (value) { case EQ_VALUE: return EQ; case NOT_EQ_VALUE: return NOT_EQ; case LESS_VALUE: return LESS; case LESS_EQ_VALUE: return LESS_EQ; case GREATER_VALUE: return GREATER; case GREATER_EQ_VALUE: return GREATER_EQ; case IN_VALUE: return IN; case ADD_VALUE: return ADD; case SUB_VALUE: return SUB; case MUL_VALUE: return MUL; case DIV_VALUE: return DIV; case POW_VALUE: return POW; } 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 BinaryOperator(int value, String name, String literal) { this.value = value; this.name = name; this.literal = literal; } /** * * * @generated */ @Override public int getValue() { return value; } /** * * * @generated */ @Override public String getName() { return name; } /** * * * @generated */ @Override public String getLiteral() { return literal; } /** * Returns the literal value of the enumerator, which is its string representation. * * * @generated */ @Override public String toString() { return literal; } } //BinaryOperator