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