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