/** * 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 'Unary Op', * and utility methods for working with them. * * @see org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage#getUnaryOp() * @model * @generated */ public enum UnaryOp implements Enumerator { /** * The 'NEG' literal object. * * * @see #NEG_VALUE * @generated * @ordered */ NEG(0, "NEG", "!"), /** * The 'PLUS' literal object. * * * @see #PLUS_VALUE * @generated * @ordered */ PLUS(1, "PLUS", "+"), /** * The 'MINUS' literal object. * * * @see #MINUS_VALUE * @generated * @ordered */ MINUS(2, "MINUS", "-"), /** * The 'MAY' literal object. * * * @see #MAY_VALUE * @generated * @ordered */ MAY(3, "MAY", "may"), /** * The 'MUST' literal object. * * * @see #MUST_VALUE * @generated * @ordered */ MUST(4, "MUST", "must"), /** * The 'CURRENT' literal object. * * * @see #CURRENT_VALUE * @generated * @ordered */ CURRENT(5, "CURRENT", "current"); /** * The 'NEG' literal value. * * * @see #NEG * @model literal="!" * @generated * @ordered */ public static final int NEG_VALUE = 0; /** * The 'PLUS' literal value. * * * @see #PLUS * @model literal="+" * @generated * @ordered */ public static final int PLUS_VALUE = 1; /** * The 'MINUS' literal value. * * * @see #MINUS * @model literal="-" * @generated * @ordered */ public static final int MINUS_VALUE = 2; /** * The 'MAY' literal value. * * * @see #MAY * @model literal="may" * @generated * @ordered */ public static final int MAY_VALUE = 3; /** * The 'MUST' literal value. * * * @see #MUST * @model literal="must" * @generated * @ordered */ public static final int MUST_VALUE = 4; /** * The 'CURRENT' literal value. * * * @see #CURRENT * @model literal="current" * @generated * @ordered */ public static final int CURRENT_VALUE = 5; /** * An array of all the 'Unary Op' enumerators. * * * @generated */ private static final UnaryOp[] VALUES_ARRAY = new UnaryOp[] { NEG, PLUS, MINUS, MAY, MUST, CURRENT, }; /** * A public read-only list of all the 'Unary Op' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'Unary Op' literal with the specified literal value. * * * @param literal the literal. * @return the matching enumerator or null. * @generated */ public static UnaryOp get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { UnaryOp result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'Unary Op' literal with the specified name. * * * @param name the name. * @return the matching enumerator or null. * @generated */ public static UnaryOp getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { UnaryOp result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'Unary Op' literal with the specified integer value. * * * @param value the integer value. * @return the matching enumerator or null. * @generated */ public static UnaryOp get(int value) { switch (value) { case NEG_VALUE: return NEG; case PLUS_VALUE: return PLUS; case MINUS_VALUE: return MINUS; case MAY_VALUE: return MAY; case MUST_VALUE: return MUST; case CURRENT_VALUE: return CURRENT; } 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 UnaryOp(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; } } //UnaryOp