001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package newprocess;
007:
008: import java.util.Arrays;
009: import java.util.Collections;
010: import java.util.List;
011:
012: import org.eclipse.emf.common.util.Enumerator;
013:
014: /**
015: * <!-- begin-user-doc -->
016: * A representation of the literals of the enumeration '<em><b>Direction</b></em>',
017: * and utility methods for working with them.
018: * <!-- end-user-doc -->
019: * @see newprocess.NewprocessPackage#getDirection()
020: * @model
021: * @generated
022: */
023: public enum Direction implements Enumerator {
024: /**
025: * The '<em><b>Incoming</b></em>' literal object.
026: * <!-- begin-user-doc -->
027: * <!-- end-user-doc -->
028: * @see #INCOMING_VALUE
029: * @generated
030: * @ordered
031: */
032: INCOMING(0, "incoming", "incoming"),
033: /**
034: * The '<em><b>Outgoing</b></em>' literal object.
035: * <!-- begin-user-doc -->
036: * <!-- end-user-doc -->
037: * @see #OUTGOING_VALUE
038: * @generated
039: * @ordered
040: */
041: OUTGOING(1, "outgoing", "outgoing");
042: /**
043: * The '<em><b>Incoming</b></em>' literal value.
044: * <!-- begin-user-doc -->
045: * <p>
046: * If the meaning of '<em><b>Incoming</b></em>' literal object isn't clear,
047: * there really should be more of a description here...
048: * </p>
049: * <!-- end-user-doc -->
050: * @see #INCOMING
051: * @model name="incoming"
052: * @generated
053: * @ordered
054: */
055: public static final int INCOMING_VALUE = 0;
056:
057: /**
058: * The '<em><b>Outgoing</b></em>' literal value.
059: * <!-- begin-user-doc -->
060: * <p>
061: * If the meaning of '<em><b>Outgoing</b></em>' literal object isn't clear,
062: * there really should be more of a description here...
063: * </p>
064: * <!-- end-user-doc -->
065: * @see #OUTGOING
066: * @model name="outgoing"
067: * @generated
068: * @ordered
069: */
070: public static final int OUTGOING_VALUE = 1;
071:
072: /**
073: * An array of all the '<em><b>Direction</b></em>' enumerators.
074: * <!-- begin-user-doc -->
075: * <!-- end-user-doc -->
076: * @generated
077: */
078: private static final Direction[] VALUES_ARRAY = new Direction[] {
079: INCOMING, OUTGOING, };
080:
081: /**
082: * A public read-only list of all the '<em><b>Direction</b></em>' enumerators.
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @generated
086: */
087: public static final List<Direction> VALUES = Collections
088: .unmodifiableList(Arrays.asList(VALUES_ARRAY));
089:
090: /**
091: * Returns the '<em><b>Direction</b></em>' literal with the specified literal value.
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: * @generated
095: */
096: public static Direction get(String literal) {
097: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
098: Direction result = VALUES_ARRAY[i];
099: if (result.toString().equals(literal)) {
100: return result;
101: }
102: }
103: return null;
104: }
105:
106: /**
107: * Returns the '<em><b>Direction</b></em>' literal with the specified name.
108: * <!-- begin-user-doc -->
109: * <!-- end-user-doc -->
110: * @generated
111: */
112: public static Direction getByName(String name) {
113: for (int i = 0; i < VALUES_ARRAY.length; ++i) {
114: Direction result = VALUES_ARRAY[i];
115: if (result.getName().equals(name)) {
116: return result;
117: }
118: }
119: return null;
120: }
121:
122: /**
123: * Returns the '<em><b>Direction</b></em>' literal with the specified integer value.
124: * <!-- begin-user-doc -->
125: * <!-- end-user-doc -->
126: * @generated
127: */
128: public static Direction get(int value) {
129: switch (value) {
130: case INCOMING_VALUE:
131: return INCOMING;
132: case OUTGOING_VALUE:
133: return OUTGOING;
134: }
135: return null;
136: }
137:
138: /**
139: * <!-- begin-user-doc -->
140: * <!-- end-user-doc -->
141: * @generated
142: */
143: private final int value;
144:
145: /**
146: * <!-- begin-user-doc -->
147: * <!-- end-user-doc -->
148: * @generated
149: */
150: private final String name;
151:
152: /**
153: * <!-- begin-user-doc -->
154: * <!-- end-user-doc -->
155: * @generated
156: */
157: private final String literal;
158:
159: /**
160: * Only this class can construct instances.
161: * <!-- begin-user-doc -->
162: * <!-- end-user-doc -->
163: * @generated
164: */
165: private Direction(int value, String name, String literal) {
166: this .value = value;
167: this .name = name;
168: this .literal = literal;
169: }
170:
171: /**
172: * <!-- begin-user-doc -->
173: * <!-- end-user-doc -->
174: * @generated
175: */
176: public int getValue() {
177: return value;
178: }
179:
180: /**
181: * <!-- begin-user-doc -->
182: * <!-- end-user-doc -->
183: * @generated
184: */
185: public String getName() {
186: return name;
187: }
188:
189: /**
190: * <!-- begin-user-doc -->
191: * <!-- end-user-doc -->
192: * @generated
193: */
194: public String getLiteral() {
195: return literal;
196: }
197:
198: /**
199: * Returns the literal value of the enumerator, which is its string representation.
200: * <!-- begin-user-doc -->
201: * <!-- end-user-doc -->
202: * @generated
203: */
204: @Override
205: public String toString() {
206: return literal;
207: }
208: }
|