blob: b39e890fdeaaaeea9bd2bda603cb2f874315b03f [file] [log] [blame]
/**
*
* Copyright (c) 2009 Hatha Systems.
* 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:
* Nikolai Mansourov (Hatha Systems) - initial API and implementation
* Gabriel Barbier (Mia-Software) - minor evolutions for version 1.1
*
* $Id$
*/
package org.eclipse.gmt.modisco.omg.kdm.code;
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>Storable Kind</b></em>',
* and utility methods for working with them.
* <!-- end-user-doc -->
* @see org.eclipse.gmt.modisco.omg.kdm.code.CodePackage#getStorableKind()
* @model
* @generated
*/
public enum StorableKind implements Enumerator {
/**
* The '<em><b>Global</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #GLOBAL_VALUE
* @generated
* @ordered
*/
GLOBAL(0, "global", "global"), //$NON-NLS-1$ //$NON-NLS-2$
/**
* The '<em><b>Local</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #LOCAL_VALUE
* @generated
* @ordered
*/
LOCAL(1, "local", "local"), //$NON-NLS-1$ //$NON-NLS-2$
/**
* The '<em><b>Static</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #STATIC_VALUE
* @generated
* @ordered
*/
STATIC(2, "static", "static"), //$NON-NLS-1$ //$NON-NLS-2$
/**
* The '<em><b>External</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #EXTERNAL_VALUE
* @generated
* @ordered
*/
EXTERNAL(3, "external", "external"), //$NON-NLS-1$ //$NON-NLS-2$
/**
* The '<em><b>Register</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #REGISTER_VALUE
* @generated
* @ordered
*/
REGISTER(4, "register", "register"), //$NON-NLS-1$ //$NON-NLS-2$
/**
* The '<em><b>Unknown</b></em>' literal object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #UNKNOWN_VALUE
* @generated
* @ordered
*/
UNKNOWN(5, "unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-2$
/**
* The '<em><b>Global</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Global</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #GLOBAL
* @model name="global"
* @generated
* @ordered
*/
public static final int GLOBAL_VALUE = 0;
/**
* The '<em><b>Local</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Local</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #LOCAL
* @model name="local"
* @generated
* @ordered
*/
public static final int LOCAL_VALUE = 1;
/**
* The '<em><b>Static</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Static</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #STATIC
* @model name="static"
* @generated
* @ordered
*/
public static final int STATIC_VALUE = 2;
/**
* The '<em><b>External</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>External</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #EXTERNAL
* @model name="external"
* @generated
* @ordered
*/
public static final int EXTERNAL_VALUE = 3;
/**
* The '<em><b>Register</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Register</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #REGISTER
* @model name="register"
* @generated
* @ordered
*/
public static final int REGISTER_VALUE = 4;
/**
* The '<em><b>Unknown</b></em>' literal value.
* <!-- begin-user-doc -->
* <p>
* If the meaning of '<em><b>Unknown</b></em>' literal object isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @see #UNKNOWN
* @model name="unknown"
* @generated
* @ordered
*/
public static final int UNKNOWN_VALUE = 5;
/**
* An array of all the '<em><b>Storable Kind</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static final StorableKind[] VALUES_ARRAY =
new StorableKind[] {
GLOBAL,
LOCAL,
STATIC,
EXTERNAL,
REGISTER,
UNKNOWN,
};
/**
* A public read-only list of all the '<em><b>Storable Kind</b></em>' enumerators.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final List<StorableKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
/**
* Returns the '<em><b>Storable Kind</b></em>' literal with the specified literal value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static StorableKind get(String literal) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
StorableKind result = VALUES_ARRAY[i];
if (result.toString().equals(literal)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Storable Kind</b></em>' literal with the specified name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static StorableKind getByName(String name) {
for (int i = 0; i < VALUES_ARRAY.length; ++i) {
StorableKind result = VALUES_ARRAY[i];
if (result.getName().equals(name)) {
return result;
}
}
return null;
}
/**
* Returns the '<em><b>Storable Kind</b></em>' literal with the specified integer value.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static StorableKind get(int value) {
switch (value) {
case GLOBAL_VALUE: return GLOBAL;
case LOCAL_VALUE: return LOCAL;
case STATIC_VALUE: return STATIC;
case EXTERNAL_VALUE: return EXTERNAL;
case REGISTER_VALUE: return REGISTER;
case UNKNOWN_VALUE: return UNKNOWN;
}
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 StorableKind(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;
}
} //StorableKind