/** * generated by Xtext 2.26.0 */ package com.minres.rdl.rdl; 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 'RValue Constant', * and utility methods for working with them. * * @see com.minres.rdl.rdl.RdlPackage#getRValueConstant() * @model * @generated */ public enum RValueConstant implements Enumerator { /** * The 'UNDEFINED' literal object. * * * @see #UNDEFINED_VALUE * @generated * @ordered */ UNDEFINED(0, "UNDEFINED", "UNDEFINED"), /** * The 'TRUE' literal object. * * * @see #TRUE_VALUE * @generated * @ordered */ TRUE(1, "TRUE", "true"), /** * The 'FALSE' literal object. * * * @see #FALSE_VALUE * @generated * @ordered */ FALSE(2, "FALSE", "false"), /** * The 'RW' literal object. * * * @see #RW_VALUE * @generated * @ordered */ RW(3, "RW", "rw"), /** * The 'WR' literal object. * * * @see #WR_VALUE * @generated * @ordered */ WR(4, "WR", "wr"), /** * The 'R' literal object. * * * @see #R_VALUE * @generated * @ordered */ R(5, "R", "r"), /** * The 'W' literal object. * * * @see #W_VALUE * @generated * @ordered */ W(6, "W", "w"), /** * The 'NA' literal object. * * * @see #NA_VALUE * @generated * @ordered */ NA(7, "NA", "na"), /** * The 'COMPACT' literal object. * * * @see #COMPACT_VALUE * @generated * @ordered */ COMPACT(8, "COMPACT", "compact"), /** * The 'REGALIGN' literal object. * * * @see #REGALIGN_VALUE * @generated * @ordered */ REGALIGN(9, "REGALIGN", "regalign"), /** * The 'FULLALIGN' literal object. * * * @see #FULLALIGN_VALUE * @generated * @ordered */ FULLALIGN(10, "FULLALIGN", "fullalign"), /** * The 'HW' literal object. * * * @see #HW_VALUE * @generated * @ordered */ HW(11, "HW", "hw"), /** * The 'SW' literal object. * * * @see #SW_VALUE * @generated * @ordered */ SW(12, "SW", "sw"); /** * The 'UNDEFINED' literal value. * * * @see #UNDEFINED * @model * @generated * @ordered */ public static final int UNDEFINED_VALUE = 0; /** * The 'TRUE' literal value. * * * @see #TRUE * @model literal="true" * @generated * @ordered */ public static final int TRUE_VALUE = 1; /** * The 'FALSE' literal value. * * * @see #FALSE * @model literal="false" * @generated * @ordered */ public static final int FALSE_VALUE = 2; /** * The 'RW' literal value. * * * @see #RW * @model literal="rw" * @generated * @ordered */ public static final int RW_VALUE = 3; /** * The 'WR' literal value. * * * @see #WR * @model literal="wr" * @generated * @ordered */ public static final int WR_VALUE = 4; /** * The 'R' literal value. * * * @see #R * @model literal="r" * @generated * @ordered */ public static final int R_VALUE = 5; /** * The 'W' literal value. * * * @see #W * @model literal="w" * @generated * @ordered */ public static final int W_VALUE = 6; /** * The 'NA' literal value. * * * @see #NA * @model literal="na" * @generated * @ordered */ public static final int NA_VALUE = 7; /** * The 'COMPACT' literal value. * * * @see #COMPACT * @model literal="compact" * @generated * @ordered */ public static final int COMPACT_VALUE = 8; /** * The 'REGALIGN' literal value. * * * @see #REGALIGN * @model literal="regalign" * @generated * @ordered */ public static final int REGALIGN_VALUE = 9; /** * The 'FULLALIGN' literal value. * * * @see #FULLALIGN * @model literal="fullalign" * @generated * @ordered */ public static final int FULLALIGN_VALUE = 10; /** * The 'HW' literal value. * * * @see #HW * @model literal="hw" * @generated * @ordered */ public static final int HW_VALUE = 11; /** * The 'SW' literal value. * * * @see #SW * @model literal="sw" * @generated * @ordered */ public static final int SW_VALUE = 12; /** * An array of all the 'RValue Constant' enumerators. * * * @generated */ private static final RValueConstant[] VALUES_ARRAY = new RValueConstant[] { UNDEFINED, TRUE, FALSE, RW, WR, R, W, NA, COMPACT, REGALIGN, FULLALIGN, HW, SW, }; /** * A public read-only list of all the 'RValue Constant' enumerators. * * * @generated */ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); /** * Returns the 'RValue Constant' literal with the specified literal value. * * * @param literal the literal. * @return the matching enumerator or null. * @generated */ public static RValueConstant get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { RValueConstant result = VALUES_ARRAY[i]; if (result.toString().equals(literal)) { return result; } } return null; } /** * Returns the 'RValue Constant' literal with the specified name. * * * @param name the name. * @return the matching enumerator or null. * @generated */ public static RValueConstant getByName(String name) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { RValueConstant result = VALUES_ARRAY[i]; if (result.getName().equals(name)) { return result; } } return null; } /** * Returns the 'RValue Constant' literal with the specified integer value. * * * @param value the integer value. * @return the matching enumerator or null. * @generated */ public static RValueConstant get(int value) { switch (value) { case UNDEFINED_VALUE: return UNDEFINED; case TRUE_VALUE: return TRUE; case FALSE_VALUE: return FALSE; case RW_VALUE: return RW; case WR_VALUE: return WR; case R_VALUE: return R; case W_VALUE: return W; case NA_VALUE: return NA; case COMPACT_VALUE: return COMPACT; case REGALIGN_VALUE: return REGALIGN; case FULLALIGN_VALUE: return FULLALIGN; case HW_VALUE: return HW; case SW_VALUE: return SW; } 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 RValueConstant(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; } } //RValueConstant