/**
 * generated by Xtext 2.12.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;

/**
 * <!-- begin-user-doc -->
 * A representation of the literals of the enumeration '<em><b>RValue Constant</b></em>',
 * and utility methods for working with them.
 * <!-- end-user-doc -->
 * @see com.minres.rdl.rdl.RdlPackage#getRValueConstant()
 * @model
 * @generated
 */
public enum RValueConstant implements Enumerator
{
  /**
   * The '<em><b>UNDEFINED</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #UNDEFINED_VALUE
   * @generated
   * @ordered
   */
  UNDEFINED(0, "UNDEFINED", "UNDEFINED"),

  /**
   * The '<em><b>TRUE</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #TRUE_VALUE
   * @generated
   * @ordered
   */
  TRUE(1, "TRUE", "true"),

  /**
   * The '<em><b>FALSE</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #FALSE_VALUE
   * @generated
   * @ordered
   */
  FALSE(2, "FALSE", "false"),

  /**
   * The '<em><b>RW</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #RW_VALUE
   * @generated
   * @ordered
   */
  RW(3, "RW", "rw"),

  /**
   * The '<em><b>WR</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #WR_VALUE
   * @generated
   * @ordered
   */
  WR(4, "WR", "wr"),

  /**
   * The '<em><b>R</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #R_VALUE
   * @generated
   * @ordered
   */
  R(5, "R", "r"),

  /**
   * The '<em><b>W</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #W_VALUE
   * @generated
   * @ordered
   */
  W(6, "W", "w"),

  /**
   * The '<em><b>NA</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #NA_VALUE
   * @generated
   * @ordered
   */
  NA(7, "NA", "na"),

  /**
   * The '<em><b>COMPACT</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #COMPACT_VALUE
   * @generated
   * @ordered
   */
  COMPACT(8, "COMPACT", "compact"),

  /**
   * The '<em><b>REGALIGN</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #REGALIGN_VALUE
   * @generated
   * @ordered
   */
  REGALIGN(9, "REGALIGN", "regalign"),

  /**
   * The '<em><b>FULLALIGN</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #FULLALIGN_VALUE
   * @generated
   * @ordered
   */
  FULLALIGN(10, "FULLALIGN", "fullalign"),

  /**
   * The '<em><b>HW</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #HW_VALUE
   * @generated
   * @ordered
   */
  HW(11, "HW", "hw"),

  /**
   * The '<em><b>SW</b></em>' literal object.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #SW_VALUE
   * @generated
   * @ordered
   */
  SW(12, "SW", "sw");

  /**
   * The '<em><b>UNDEFINED</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>UNDEFINED</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #UNDEFINED
   * @model
   * @generated
   * @ordered
   */
  public static final int UNDEFINED_VALUE = 0;

  /**
   * The '<em><b>TRUE</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>TRUE</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #TRUE
   * @model literal="true"
   * @generated
   * @ordered
   */
  public static final int TRUE_VALUE = 1;

  /**
   * The '<em><b>FALSE</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>FALSE</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #FALSE
   * @model literal="false"
   * @generated
   * @ordered
   */
  public static final int FALSE_VALUE = 2;

  /**
   * The '<em><b>RW</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>RW</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #RW
   * @model literal="rw"
   * @generated
   * @ordered
   */
  public static final int RW_VALUE = 3;

  /**
   * The '<em><b>WR</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>WR</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #WR
   * @model literal="wr"
   * @generated
   * @ordered
   */
  public static final int WR_VALUE = 4;

  /**
   * The '<em><b>R</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>R</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #R
   * @model literal="r"
   * @generated
   * @ordered
   */
  public static final int R_VALUE = 5;

  /**
   * The '<em><b>W</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>W</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #W
   * @model literal="w"
   * @generated
   * @ordered
   */
  public static final int W_VALUE = 6;

  /**
   * The '<em><b>NA</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>NA</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #NA
   * @model literal="na"
   * @generated
   * @ordered
   */
  public static final int NA_VALUE = 7;

  /**
   * The '<em><b>COMPACT</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>COMPACT</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #COMPACT
   * @model literal="compact"
   * @generated
   * @ordered
   */
  public static final int COMPACT_VALUE = 8;

  /**
   * The '<em><b>REGALIGN</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>REGALIGN</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #REGALIGN
   * @model literal="regalign"
   * @generated
   * @ordered
   */
  public static final int REGALIGN_VALUE = 9;

  /**
   * The '<em><b>FULLALIGN</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>FULLALIGN</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #FULLALIGN
   * @model literal="fullalign"
   * @generated
   * @ordered
   */
  public static final int FULLALIGN_VALUE = 10;

  /**
   * The '<em><b>HW</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>HW</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #HW
   * @model literal="hw"
   * @generated
   * @ordered
   */
  public static final int HW_VALUE = 11;

  /**
   * The '<em><b>SW</b></em>' literal value.
   * <!-- begin-user-doc -->
   * <p>
   * If the meaning of '<em><b>SW</b></em>' literal object isn't clear,
   * there really should be more of a description here...
   * </p>
   * <!-- end-user-doc -->
   * @see #SW
   * @model literal="sw"
   * @generated
   * @ordered
   */
  public static final int SW_VALUE = 12;

  /**
   * An array of all the '<em><b>RValue Constant</b></em>' enumerators.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @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 '<em><b>RValue Constant</b></em>' enumerators.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static final List<RValueConstant> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

  /**
   * Returns the '<em><b>RValue Constant</b></em>' literal with the specified literal value.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @param literal the literal.
   * @return the matching enumerator or <code>null</code>.
   * @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 '<em><b>RValue Constant</b></em>' literal with the specified name.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @param name the name.
   * @return the matching enumerator or <code>null</code>.
   * @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 '<em><b>RValue Constant</b></em>' literal with the specified integer value.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @param value the integer value.
   * @return the matching enumerator or <code>null</code>.
   * @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;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private final int value;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private final String name;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private final String literal;

  /**
   * Only this class can construct instances.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  private RValueConstant(int value, String name, String literal)
  {
    this.value = value;
    this.name = name;
    this.literal = literal;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getValue()
  {
    return value;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getName()
  {
    return name;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getLiteral()
  {
    return literal;
  }

  /**
   * Returns the literal value of the enumerator, which is its string representation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    return literal;
  }
  
} //RValueConstant
