| /**
|
| *
|
| * Copyright (c) 2009, 2019 Hatha Systems.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| * Nikolai Mansourov (Hatha Systems) - initial API and implementation
|
| * Gabriel Barbier (Mia-Software) - minor evolutions for version 1.1
|
| *
|
| * $Id$
|
| */ |
| package org.eclipse.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>Callable Kind</b></em>',
|
| * and utility methods for working with them.
|
| * <!-- end-user-doc -->
|
| * @see org.eclipse.modisco.omg.kdm.code.CodePackage#getCallableKind()
|
| * @model
|
| * @generated
|
| */
|
| public enum CallableKind implements Enumerator {
|
| /**
|
| * The '<em><b>External</b></em>' literal object.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #EXTERNAL_VALUE
|
| * @generated
|
| * @ordered
|
| */
|
| EXTERNAL(0, "external", "external"), //$NON-NLS-1$ //$NON-NLS-2$
|
|
|
| /**
|
| * The '<em><b>Regular</b></em>' literal object.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #REGULAR_VALUE
|
| * @generated
|
| * @ordered
|
| */
|
| REGULAR(1, "regular", "regular"), //$NON-NLS-1$ //$NON-NLS-2$
|
|
|
| /**
|
| * The '<em><b>Operator</b></em>' literal object.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #OPERATOR_VALUE
|
| * @generated
|
| * @ordered
|
| */
|
| OPERATOR(2, "operator", "operator"), //$NON-NLS-1$ //$NON-NLS-2$
|
|
|
| /**
|
| * The '<em><b>Stored</b></em>' literal object.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #STORED_VALUE
|
| * @generated
|
| * @ordered
|
| */
|
| STORED(3, "stored", "stored"), //$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(4, "unknown", "unknown"); //$NON-NLS-1$ //$NON-NLS-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 = 0;
|
|
|
| /**
|
| * The '<em><b>Regular</b></em>' literal value.
|
| * <!-- begin-user-doc -->
|
| * <p>
|
| * If the meaning of '<em><b>Regular</b></em>' literal object isn't clear,
|
| * there really should be more of a description here...
|
| * </p>
|
| * <!-- end-user-doc -->
|
| * @see #REGULAR
|
| * @model name="regular"
|
| * @generated
|
| * @ordered
|
| */
|
| public static final int REGULAR_VALUE = 1;
|
|
|
| /**
|
| * The '<em><b>Operator</b></em>' literal value.
|
| * <!-- begin-user-doc -->
|
| * <p>
|
| * If the meaning of '<em><b>Operator</b></em>' literal object isn't clear,
|
| * there really should be more of a description here...
|
| * </p>
|
| * <!-- end-user-doc -->
|
| * @see #OPERATOR
|
| * @model name="operator"
|
| * @generated
|
| * @ordered
|
| */
|
| public static final int OPERATOR_VALUE = 2;
|
|
|
| /**
|
| * The '<em><b>Stored</b></em>' literal value.
|
| * <!-- begin-user-doc -->
|
| * <p>
|
| * If the meaning of '<em><b>Stored</b></em>' literal object isn't clear,
|
| * there really should be more of a description here...
|
| * </p>
|
| * <!-- end-user-doc -->
|
| * @see #STORED
|
| * @model name="stored"
|
| * @generated
|
| * @ordered
|
| */
|
| public static final int STORED_VALUE = 3;
|
|
|
| /**
|
| * 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 = 4;
|
|
|
| /**
|
| * An array of all the '<em><b>Callable Kind</b></em>' enumerators.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| private static final CallableKind[] VALUES_ARRAY =
|
| new CallableKind[] {
|
| EXTERNAL,
|
| REGULAR,
|
| OPERATOR,
|
| STORED,
|
| UNKNOWN,
|
| };
|
|
|
| /**
|
| * A public read-only list of all the '<em><b>Callable Kind</b></em>' enumerators.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public static final List<CallableKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
|
|
|
| /**
|
| * Returns the '<em><b>Callable Kind</b></em>' literal with the specified literal value.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public static CallableKind get(String literal) {
|
| for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
| CallableKind result = VALUES_ARRAY[i];
|
| if (result.toString().equals(literal)) {
|
| return result;
|
| }
|
| }
|
| return null;
|
| }
|
|
|
| /**
|
| * Returns the '<em><b>Callable Kind</b></em>' literal with the specified name.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public static CallableKind getByName(String name) {
|
| for (int i = 0; i < VALUES_ARRAY.length; ++i) {
|
| CallableKind result = VALUES_ARRAY[i];
|
| if (result.getName().equals(name)) {
|
| return result;
|
| }
|
| }
|
| return null;
|
| }
|
|
|
| /**
|
| * Returns the '<em><b>Callable Kind</b></em>' literal with the specified integer value.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public static CallableKind get(int value) {
|
| switch (value) {
|
| case EXTERNAL_VALUE: return EXTERNAL;
|
| case REGULAR_VALUE: return REGULAR;
|
| case OPERATOR_VALUE: return OPERATOR;
|
| case STORED_VALUE: return STORED;
|
| 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 CallableKind(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;
|
| }
|
|
|
| } //CallableKind
|