| /** |
| * Copyright (c) 2020 CEA LIST |
| * |
| * 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 |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| */ |
| package org.eclipse.papyrus.aiml.profile.AIML.Tensor; |
| |
| 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>ETensor Types</b></em>', |
| * and utility methods for working with them. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.papyrus.aiml.profile.AIML.Tensor.TensorPackage#getETensorTypes() |
| * @model |
| * @generated |
| */ |
| public enum ETensorTypes implements Enumerator { |
| /** |
| * The '<em><b>Float Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #FLOAT_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| FLOAT_TENSOR(0, "FloatTensor", "FloatTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Double Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #DOUBLE_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| DOUBLE_TENSOR(1, "DoubleTensor", "DoubleTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Half Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #HALF_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| HALF_TENSOR(2, "HalfTensor", "HalfTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Byte Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #BYTE_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| BYTE_TENSOR(3, "ByteTensor", "ByteTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Char Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #CHAR_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| CHAR_TENSOR(4, "CharTensor", "CharTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Short Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #SHORT_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| SHORT_TENSOR(5, "ShortTensor", "ShortTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Int Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #INT_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| INT_TENSOR(6, "IntTensor", "IntTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Long Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #LONG_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| LONG_TENSOR(7, "LongTensor", "LongTensor"), //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Bool Tensor</b></em>' literal object. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #BOOL_TENSOR_VALUE |
| * @generated |
| * @ordered |
| */ |
| BOOL_TENSOR(8, "BoolTensor", "BoolTensor"); //$NON-NLS-1$ //$NON-NLS-2$ |
| |
| /** |
| * The '<em><b>Float Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #FLOAT_TENSOR |
| * @model name="FloatTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int FLOAT_TENSOR_VALUE = 0; |
| |
| /** |
| * The '<em><b>Double Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #DOUBLE_TENSOR |
| * @model name="DoubleTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int DOUBLE_TENSOR_VALUE = 1; |
| |
| /** |
| * The '<em><b>Half Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #HALF_TENSOR |
| * @model name="HalfTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int HALF_TENSOR_VALUE = 2; |
| |
| /** |
| * The '<em><b>Byte Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #BYTE_TENSOR |
| * @model name="ByteTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int BYTE_TENSOR_VALUE = 3; |
| |
| /** |
| * The '<em><b>Char Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #CHAR_TENSOR |
| * @model name="CharTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int CHAR_TENSOR_VALUE = 4; |
| |
| /** |
| * The '<em><b>Short Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #SHORT_TENSOR |
| * @model name="ShortTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int SHORT_TENSOR_VALUE = 5; |
| |
| /** |
| * The '<em><b>Int Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #INT_TENSOR |
| * @model name="IntTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int INT_TENSOR_VALUE = 6; |
| |
| /** |
| * The '<em><b>Long Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #LONG_TENSOR |
| * @model name="LongTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int LONG_TENSOR_VALUE = 7; |
| |
| /** |
| * The '<em><b>Bool Tensor</b></em>' literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #BOOL_TENSOR |
| * @model name="BoolTensor" |
| * @generated |
| * @ordered |
| */ |
| public static final int BOOL_TENSOR_VALUE = 8; |
| |
| /** |
| * An array of all the '<em><b>ETensor Types</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static final ETensorTypes[] VALUES_ARRAY = |
| new ETensorTypes[] { |
| FLOAT_TENSOR, |
| DOUBLE_TENSOR, |
| HALF_TENSOR, |
| BYTE_TENSOR, |
| CHAR_TENSOR, |
| SHORT_TENSOR, |
| INT_TENSOR, |
| LONG_TENSOR, |
| BOOL_TENSOR, |
| }; |
| |
| /** |
| * A public read-only list of all the '<em><b>ETensor Types</b></em>' enumerators. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final List<ETensorTypes> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); |
| |
| /** |
| * Returns the '<em><b>ETensor Types</b></em>' literal with the specified literal value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param literal the literal. |
| * @return the matching enumerator or <code>null</code>. |
| * @generated |
| */ |
| public static ETensorTypes get(String literal) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| ETensorTypes result = VALUES_ARRAY[i]; |
| if (result.toString().equals(literal)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>ETensor Types</b></em>' literal with the specified name. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param name the name. |
| * @return the matching enumerator or <code>null</code>. |
| * @generated |
| */ |
| public static ETensorTypes getByName(String name) { |
| for (int i = 0; i < VALUES_ARRAY.length; ++i) { |
| ETensorTypes result = VALUES_ARRAY[i]; |
| if (result.getName().equals(name)) { |
| return result; |
| } |
| } |
| return null; |
| } |
| |
| /** |
| * Returns the '<em><b>ETensor Types</b></em>' literal with the specified integer value. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the integer value. |
| * @return the matching enumerator or <code>null</code>. |
| * @generated |
| */ |
| public static ETensorTypes get(int value) { |
| switch (value) { |
| case FLOAT_TENSOR_VALUE: return FLOAT_TENSOR; |
| case DOUBLE_TENSOR_VALUE: return DOUBLE_TENSOR; |
| case HALF_TENSOR_VALUE: return HALF_TENSOR; |
| case BYTE_TENSOR_VALUE: return BYTE_TENSOR; |
| case CHAR_TENSOR_VALUE: return CHAR_TENSOR; |
| case SHORT_TENSOR_VALUE: return SHORT_TENSOR; |
| case INT_TENSOR_VALUE: return INT_TENSOR; |
| case LONG_TENSOR_VALUE: return LONG_TENSOR; |
| case BOOL_TENSOR_VALUE: return BOOL_TENSOR; |
| } |
| 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 ETensorTypes(int value, String name, String literal) { |
| this.value = value; |
| this.name = name; |
| this.literal = literal; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int getValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| 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; |
| } |
| |
| } //ETensorTypes |