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>Height 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#getHeightKind()
024: * @model
025: * @generated
026: */
027: public final class HeightKind extends AbstractEnumerator {
028: /**
029: * The '<em><b>Inches</b></em>' literal value.
030: * <!-- begin-user-doc -->
031: * <p>
032: * If the meaning of '<em><b>Inches</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 #INCHES_LITERAL
037: * @model name="inches"
038: * @generated
039: * @ordered
040: */
041: public static final int INCHES = 0;
042:
043: /**
044: * The '<em><b>Centimeters</b></em>' literal value.
045: * <!-- begin-user-doc -->
046: * <p>
047: * If the meaning of '<em><b>Centimeters</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 #CENTIMETERS_LITERAL
052: * @model name="centimeters"
053: * @generated
054: * @ordered
055: */
056: public static final int CENTIMETERS = 1;
057:
058: /**
059: * The '<em><b>Inches</b></em>' literal object.
060: * <!-- begin-user-doc -->
061: * <!-- end-user-doc -->
062: * @see #INCHES
063: * @generated
064: * @ordered
065: */
066: public static final HeightKind INCHES_LITERAL = new HeightKind(
067: INCHES, "inches", "inches"); //$NON-NLS-1$ //$NON-NLS-2$
068:
069: /**
070: * The '<em><b>Centimeters</b></em>' literal object.
071: * <!-- begin-user-doc -->
072: * <!-- end-user-doc -->
073: * @see #CENTIMETERS
074: * @generated
075: * @ordered
076: */
077: public static final HeightKind CENTIMETERS_LITERAL = new HeightKind(
078: CENTIMETERS, "centimeters", "centimeters"); //$NON-NLS-1$ //$NON-NLS-2$
079:
080: /**
081: * An array of all the '<em><b>Height Kind</b></em>' enumerators.
082: * <!-- begin-user-doc -->
083: * <!-- end-user-doc -->
084: * @generated
085: */
086: private static final HeightKind[] VALUES_ARRAY = new HeightKind[] {
087: INCHES_LITERAL, CENTIMETERS_LITERAL, };
088:
089: /**
090: * A public read-only list of all the '<em><b>Height 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>Height Kind</b></em>' literal with the specified literal value.
100: * <!-- begin-user-doc -->
101: * <!-- end-user-doc -->
102: * @generated
103: */
104: public static HeightKind get(String literal) {
105: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
106: HeightKind 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>Height Kind</b></em>' literal with the specified name.
116: * <!-- begin-user-doc -->
117: * <!-- end-user-doc -->
118: * @generated
119: */
120: public static HeightKind getByName(String name) {
121: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
122: HeightKind 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>Height Kind</b></em>' literal with the specified integer value.
132: * <!-- begin-user-doc -->
133: * <!-- end-user-doc -->
134: * @generated
135: */
136: public static HeightKind get(int value) {
137: switch (value) {
138: case INCHES:
139: return INCHES_LITERAL;
140: case CENTIMETERS:
141: return CENTIMETERS_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 HeightKind(int value, String name, String literal) {
153: super (value, name, literal);
154: }
155:
156: } //HeightKind
|