| /** |
| * <copyright> |
| * |
| * Copyright (c) 2011, 2011 SAP AG. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * SAP AG - initial API, implementation and documentation |
| * |
| * </copyright> |
| */ |
| package org.eclipse.graphiti.examples.mm.chess; |
| |
| 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>Ranks</b></em>', |
| * and utility methods for working with them. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.graphiti.examples.mm.chess.ChessPackage#getRanks() |
| * @model |
| * @generated |
| */ |
| public enum Ranks implements Enumerator { |
| /** |
| * The '<em><b>None</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #NONE_VALUE |
| * @generated |
| * @ordered |
| */ |
| NONE(0, "none", "none"), /** |
| * The '<em><b>One</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #ONE_VALUE |
| * @generated |
| * @ordered |
| */ |
| ONE(1, "one", "one"), |
| |
| /** |
| * The '<em><b>Two</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #TWO_VALUE |
| * @generated |
| * @ordered |
| */ |
| TWO(2, "two", "two"), |
| |
| /** |
| * The '<em><b>Three</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #THREE_VALUE |
| * @generated |
| * @ordered |
| */ |
| THREE(3, "three", "three"), |
| |
| /** |
| * The '<em><b>Four</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #FOUR_VALUE |
| * @generated |
| * @ordered |
| */ |
| FOUR(4, "four", "four"), |
| |
| /** |
| * The '<em><b>Five</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #FIVE_VALUE |
| * @generated |
| * @ordered |
| */ |
| FIVE(5, "five", "five"), |
| |
| /** |
| * The '<em><b>Six</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #SIX_VALUE |
| * @generated |
| * @ordered |
| */ |
| SIX(6, "six", "six"), |
| |
| /** |
| * The '<em><b>Seven</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #SEVEN_VALUE |
| * @generated |
| * @ordered |
| */ |
| SEVEN(7, "seven", "seven"), |
| |
| /** |
| * The '<em><b>Eight</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #EIGHT_VALUE |
| * @generated |
| * @ordered |
| */ |
| EIGHT(8, "eight", "eight"); |
| |
| /** |
| * The '<em><b>None</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>None</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #NONE |
| * @model name="none" |
| * @generated |
| * @ordered |
| */ |
| public static final int NONE_VALUE = 0; |
| |
| /** |
| * The '<em><b>One</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>One</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #ONE |
| * @model name="one" |
| * @generated |
| * @ordered |
| */ |
| public static final int ONE_VALUE = 1; |
| |
| /** |
| * The '<em><b>Two</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Two</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #TWO |
| * @model name="two" |
| * @generated |
| * @ordered |
| */ |
| public static final int TWO_VALUE = 2; |
| |
| /** |
| * The '<em><b>Three</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Three</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #THREE |
| * @model name="three" |
| * @generated |
| * @ordered |
| */ |
| public static final int THREE_VALUE = 3; |
| |
| /** |
| * The '<em><b>Four</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Four</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #FOUR |
| * @model name="four" |
| * @generated |
| * @ordered |
| */ |
| public static final int FOUR_VALUE = 4; |
| |
| /** |
| * The '<em><b>Five</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Five</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #FIVE |
| * @model name="five" |
| * @generated |
| * @ordered |
| */ |
| public static final int FIVE_VALUE = 5; |
| |
| /** |
| * The '<em><b>Six</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Six</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #SIX |
| * @model name="six" |
| * @generated |
| * @ordered |
| */ |
| public static final int SIX_VALUE = 6; |
| |
| /** |
| * The '<em><b>Seven</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Seven</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #SEVEN |
| * @model name="seven" |
| * @generated |
| * @ordered |
| */ |
| public static final int SEVEN_VALUE = 7; |
| |
| /** |
| * The '<em><b>Eight</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Eight</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #EIGHT |
| * @model name="eight" |
| * @generated |
| * @ordered |
| */ |
| public static final int EIGHT_VALUE = 8; |
| |
| /** |
| * An array of all the '<em><b>Ranks</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static final Ranks[] VALUES_ARRAY = |
| new Ranks[] { |
| NONE, |
| ONE, |
| TWO, |
| THREE, |
| FOUR, |
| FIVE, |
| SIX, |
| SEVEN, |
| EIGHT, |
| }; |
| |
| /** |
| * A public read-only list of all the '<em><b>Ranks</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final List<Ranks> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| |
| /** |
| * Returns the '<em><b>Ranks</b></em>' literal with the specified literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static Ranks get(String literal) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| Ranks result = VALUES_ARRAY[i]; |
| if (result.toString().equals(literal)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Ranks</b></em>' literal with the specified name. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static Ranks getByName(String name) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| Ranks result = VALUES_ARRAY[i]; |
| if (result.getName().equals(name)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Ranks</b></em>' literal with the specified integer value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static Ranks get(int value) { |
| switch (value) { |
| case NONE_VALUE: return NONE; |
| case ONE_VALUE: return ONE; |
| case TWO_VALUE: return TWO; |
| case THREE_VALUE: return THREE; |
| case FOUR_VALUE: return FOUR; |
| case FIVE_VALUE: return FIVE; |
| case SIX_VALUE: return SIX; |
| case SEVEN_VALUE: return SEVEN; |
| case EIGHT_VALUE: return EIGHT; |
| } |
| 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 Ranks(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; |
| } |
| |
| } //Ranks |