| /** |
| * * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro |
| * * 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: |
| * * Istvan Rath, Daniel Varro - initial API and implementation |
| * |
| */ |
| package org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.enums; |
| |
| 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>Value Kind</b></em>', |
| * and utility methods for working with them. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.enums.EnumsPackage#getValueKind() |
| * @model |
| * @generated |
| */ |
| public enum ValueKind implements Enumerator |
| { |
| /** |
| * The '<em><b>Undef</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #UNDEF |
| * @generated |
| * @ordered |
| */ |
| UNDEF_LITERAL(0, "undef", "undef"), |
| |
| /** |
| * The '<em><b>Boolean</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #BOOLEAN |
| * @generated |
| * @ordered |
| */ |
| BOOLEAN_LITERAL(1, "boolean", "boolean"), |
| |
| /** |
| * The '<em><b>String</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #STRING |
| * @generated |
| * @ordered |
| */ |
| STRING_LITERAL(2, "string", "string"), |
| |
| /** |
| * The '<em><b>Integer</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #INTEGER |
| * @generated |
| * @ordered |
| */ |
| INTEGER_LITERAL(3, "integer", "integer"), |
| |
| /** |
| * The '<em><b>Double</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #DOUBLE |
| * @generated |
| * @ordered |
| */ |
| DOUBLE_LITERAL(4, "double", "double"), |
| |
| /** |
| * The '<em><b>Modelelement</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #MODELELEMENT |
| * @generated |
| * @ordered |
| */ |
| MODELELEMENT_LITERAL(5, "modelelement", "modelelement"), |
| |
| /** |
| * The '<em><b>Multiplicity</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #MULTIPLICITY |
| * @generated |
| * @ordered |
| */ |
| MULTIPLICITY_LITERAL(6, "multiplicity", "multiplicity"), |
| |
| /** |
| * The '<em><b>Error</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #ERROR |
| * @generated |
| * @ordered |
| */ |
| ERROR_LITERAL(7, "error", "error"); |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = " * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors:\r\n * Istvan Rath, Daniel Varro - initial API and implementation\r\n"; |
| |
| /** |
| * The '<em><b>Undef</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Undef</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #UNDEF_LITERAL |
| * @model name="undef" |
| * @generated |
| * @ordered |
| */ |
| public static final int UNDEF = 0; |
| |
| /** |
| * The '<em><b>Boolean</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Boolean</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #BOOLEAN_LITERAL |
| * @model name="boolean" |
| * @generated |
| * @ordered |
| */ |
| public static final int BOOLEAN = 1; |
| |
| /** |
| * The '<em><b>String</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>String</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #STRING_LITERAL |
| * @model name="string" |
| * @generated |
| * @ordered |
| */ |
| public static final int STRING = 2; |
| |
| /** |
| * The '<em><b>Integer</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Integer</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #INTEGER_LITERAL |
| * @model name="integer" |
| * @generated |
| * @ordered |
| */ |
| public static final int INTEGER = 3; |
| |
| /** |
| * The '<em><b>Double</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Double</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #DOUBLE_LITERAL |
| * @model name="double" |
| * @generated |
| * @ordered |
| */ |
| public static final int DOUBLE = 4; |
| |
| /** |
| * The '<em><b>Modelelement</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Modelelement</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #MODELELEMENT_LITERAL |
| * @model name="modelelement" |
| * @generated |
| * @ordered |
| */ |
| public static final int MODELELEMENT = 5; |
| |
| /** |
| * The '<em><b>Multiplicity</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Multiplicity</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #MULTIPLICITY_LITERAL |
| * @model name="multiplicity" |
| * @generated |
| * @ordered |
| */ |
| public static final int MULTIPLICITY = 6; |
| |
| /** |
| * The '<em><b>Error</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of '<em><b>Error</b></em>' literal object isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @see #ERROR_LITERAL |
| * @model name="error" |
| * @generated |
| * @ordered |
| */ |
| public static final int ERROR = 7; |
| |
| /** |
| * An array of all the '<em><b>Value Kind</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static final ValueKind[] VALUES_ARRAY = |
| new ValueKind[] |
| { |
| UNDEF_LITERAL, |
| BOOLEAN_LITERAL, |
| STRING_LITERAL, |
| INTEGER_LITERAL, |
| DOUBLE_LITERAL, |
| MODELELEMENT_LITERAL, |
| MULTIPLICITY_LITERAL, |
| ERROR_LITERAL, |
| }; |
| |
| /** |
| * A public read-only list of all the '<em><b>Value Kind</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final List<ValueKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| |
| /** |
| * Returns the '<em><b>Value Kind</b></em>' literal with the specified literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ValueKind get(String literal) |
| { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) |
| { |
| ValueKind result = VALUES_ARRAY[i]; |
| if (result.toString().equals(literal)) |
| { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Value Kind</b></em>' literal with the specified name. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ValueKind getByName(String name) |
| { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) |
| { |
| ValueKind result = VALUES_ARRAY[i]; |
| if (result.getName().equals(name)) |
| { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>Value Kind</b></em>' literal with the specified integer value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static ValueKind get(int value) |
| { |
| switch (value) |
| { |
| case UNDEF: return UNDEF_LITERAL; |
| case BOOLEAN: return BOOLEAN_LITERAL; |
| case STRING: return STRING_LITERAL; |
| case INTEGER: return INTEGER_LITERAL; |
| case DOUBLE: return DOUBLE_LITERAL; |
| case MODELELEMENT: return MODELELEMENT_LITERAL; |
| case MULTIPLICITY: return MULTIPLICITY_LITERAL; |
| case ERROR: return ERROR_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 ValueKind(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; |
| } |
| |
| } //ValueKind |