blob: 7cc32f65f2855aa704669d0d760d834b5634b134 [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2007,2010 Eclipse Modeling Project.
* 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:
* E.D.Willink - initial API and implementation
*
* </copyright>
*
* $Id: UnresolvedEnum.java,v 1.1 2010/03/11 11:54:56 ewillink Exp $
*/
package org.eclipse.ocl.examples.parser.unresolved;
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>Enum</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.eclipse.ocl.examples.parser.unresolved.UnresolvedPackage#getUnresolvedEnum()
* @model
* @generated
*/
public enum UnresolvedEnum implements Enumerator {
/**
* The '<em><b>UNRESOLVED ENUM LITERAL</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #UNRESOLVED_ENUM_LITERAL_VALUE
* @generated
* @ordered
*/
UNRESOLVED_ENUM_LITERAL(0, "UNRESOLVED_ENUM_LITERAL", "UNRESOLVED_ENUM_LITERAL");
/**
* The '<em><b>UNRESOLVED ENUM LITERAL</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>UNRESOLVED ENUM LITERAL</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #UNRESOLVED_ENUM_LITERAL
* @model
* @generated
* @ordered
*/
public static final int UNRESOLVED_ENUM_LITERAL_VALUE = 0;
/**
* An array of all the '<em><b>Enum</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final UnresolvedEnum[] VALUES_ARRAY =
new UnresolvedEnum[] {
UNRESOLVED_ENUM_LITERAL,
};
/**
* A public read-only list of all the '<em><b>Enum</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<UnresolvedEnum> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Enum</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static UnresolvedEnum get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
UnresolvedEnum result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Enum</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static UnresolvedEnum getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
UnresolvedEnum result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Enum</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static UnresolvedEnum get(int value) {
switch (value) {
case UNRESOLVED_ENUM_LITERAL_VALUE: return UNRESOLVED_ENUM_LITERAL;
}
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 UnresolvedEnum(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;
}
} //UnresolvedEnum