001: /*******************************************************************************
002: * Copyright (c) 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.examples.views.properties.tabbed.hockeyleague;
011:
012: import java.util.Arrays;
013: import java.util.Collections;
014: import java.util.List;
015:
016: import org.eclipse.emf.common.util.AbstractEnumerator;
017:
018: /**
019: * <!-- begin-user-doc -->
020: * A representation of the literals of the enumeration '<em><b>Shot Kind</b></em>',
021: * and utility methods for working with them.
022: * <!-- end-user-doc -->
023: * @see org.eclipse.ui.examples.views.properties.tabbed.hockeyleague.HockeyleaguePackage#getShotKind()
024: * @model
025: * @generated
026: */
027: public final class ShotKind extends AbstractEnumerator {
028: /**
029: * The '<em><b>Left</b></em>' literal value.
030: * <!-- begin-user-doc -->
031: * <p>
032: * If the meaning of '<em><b>Left</b></em>' literal object isn't clear,
033: * there really should be more of a description here...
034: * </p>
035: * <!-- end-user-doc -->
036: * @see #LEFT_LITERAL
037: * @model name="left"
038: * @generated
039: * @ordered
040: */
041: public static final int LEFT = 0;
042:
043: /**
044: * The '<em><b>Right</b></em>' literal value.
045: * <!-- begin-user-doc -->
046: * <p>
047: * If the meaning of '<em><b>Right</b></em>' literal object isn't clear,
048: * there really should be more of a description here...
049: * </p>
050: * <!-- end-user-doc -->
051: * @see #RIGHT_LITERAL
052: * @model name="right"
053: * @generated
054: * @ordered
055: */
056: public static final int RIGHT = 1;
057:
058: /**
059: * The '<em><b>Left</b></em>' literal object.
060: * <!-- begin-user-doc -->
061: * <!-- end-user-doc -->
062: * @see #LEFT
063: * @generated
064: * @ordered
065: */
066: public static final ShotKind LEFT_LITERAL = new ShotKind(LEFT,
067: "left", "left"); //$NON-NLS-1$ //$NON-NLS-2$
068:
069: /**
070: * The '<em><b>Right</b></em>' literal object.
071: * <!-- begin-user-doc -->
072: * <!-- end-user-doc -->
073: * @see #RIGHT
074: * @generated
075: * @ordered
076: */
077: public static final ShotKind RIGHT_LITERAL = new ShotKind(RIGHT,
078: "right", "right"); //$NON-NLS-1$ //$NON-NLS-2$
079:
080: /**
081: * An array of all the '<em><b>Shot Kind</b></em>' enumerators.
082: * <!-- begin-user-doc -->
083: * <!-- end-user-doc -->
084: * @generated
085: */
086: private static final ShotKind[] VALUES_ARRAY = new ShotKind[] {
087: LEFT_LITERAL, RIGHT_LITERAL, };
088:
089: /**
090: * A public read-only list of all the '<em><b>Shot Kind</b></em>' enumerators.
091: * <!-- begin-user-doc -->
092: * <!-- end-user-doc -->
093: * @generated
094: */
095: public static final List VALUES = Collections
096: .unmodifiableList(Arrays.asList(VALUES_ARRAY));
097:
098: /**
099: * Returns the '<em><b>Shot Kind</b></em>' literal with the specified literal value.
100: * <!-- begin-user-doc -->
101: * <!-- end-user-doc -->
102: * @generated
103: */
104: public static ShotKind get(String literal) {
105: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
106: ShotKind result = VALUES_ARRAY[i];
107: if (result.toString().equals(literal)) {
108: return result;
109: }
110: }
111: return null;
112: }
113:
114: /**
115: * Returns the '<em><b>Shot Kind</b></em>' literal with the specified name.
116: * <!-- begin-user-doc -->
117: * <!-- end-user-doc -->
118: * @generated
119: */
120: public static ShotKind getByName(String name) {
121: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
122: ShotKind result = VALUES_ARRAY[i];
123: if (result.getName().equals(name)) {
124: return result;
125: }
126: }
127: return null;
128: }
129:
130: /**
131: * Returns the '<em><b>Shot Kind</b></em>' literal with the specified integer value.
132: * <!-- begin-user-doc -->
133: * <!-- end-user-doc -->
134: * @generated
135: */
136: public static ShotKind get(int value) {
137: switch (value) {
138: case LEFT:
139: return LEFT_LITERAL;
140: case RIGHT:
141: return RIGHT_LITERAL;
142: }
143: return null;
144: }
145:
146: /**
147: * Only this class can construct instances.
148: * <!-- begin-user-doc -->
149: * <!-- end-user-doc -->
150: * @generated
151: */
152: private ShotKind(int value, String name, String literal) {
153: super (value, name, literal);
154: }
155:
156: } //ShotKind
|