/** | |
* Copyright (c) 2018 CEA LIST. | |
* | |
* 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: | |
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr | |
* - Initial API and Implementation | |
*/ | |
package org.eclipse.efm.ecore.formalml.datatype; | |
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>Primitive Type Kind</b></em>', | |
* and utility methods for working with them. | |
* <!-- end-user-doc --> | |
* @see org.eclipse.efm.ecore.formalml.datatype.DatatypePackage#getPrimitiveTypeKind() | |
* @model | |
* @generated | |
*/ | |
public enum PrimitiveTypeKind implements Enumerator { | |
/** | |
* The '<em><b>Boolean</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #BOOLEAN_VALUE | |
* @generated | |
* @ordered | |
*/ | |
BOOLEAN(0, "boolean", "boolean"), | |
/** | |
* The '<em><b>Int</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #INT_VALUE | |
* @generated | |
* @ordered | |
*/ | |
INT(1, "int", "int"), | |
/** | |
* The '<em><b>Integer</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #INTEGER_VALUE | |
* @generated | |
* @ordered | |
*/ | |
INTEGER(2, "integer", "integer"), | |
/** | |
* The '<em><b>Rat</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #RAT_VALUE | |
* @generated | |
* @ordered | |
*/ | |
RAT(3, "rat", "rat"), | |
/** | |
* The '<em><b>Rational</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #RATIONAL_VALUE | |
* @generated | |
* @ordered | |
*/ | |
RATIONAL(4, "rational", "rational"), | |
/** | |
* The '<em><b>Float</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #FLOAT_VALUE | |
* @generated | |
* @ordered | |
*/ | |
FLOAT(5, "float", "float"), | |
/** | |
* The '<em><b>Double</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #DOUBLE_VALUE | |
* @generated | |
* @ordered | |
*/ | |
DOUBLE(6, "double", "double"), | |
/** | |
* The '<em><b>Real</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #REAL_VALUE | |
* @generated | |
* @ordered | |
*/ | |
REAL(7, "real", "real"), | |
/** | |
* The '<em><b>Time</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #TIME_VALUE | |
* @generated | |
* @ordered | |
*/ | |
TIME(8, "time", "time"), | |
/** | |
* The '<em><b>Uint</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #UINT_VALUE | |
* @generated | |
* @ordered | |
*/ | |
UINT(9, "uint", "uint"), | |
/** | |
* The '<em><b>Uinteger</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #UINTEGER_VALUE | |
* @generated | |
* @ordered | |
*/ | |
UINTEGER(10, "uinteger", "uinteger"), | |
/** | |
* The '<em><b>Urat</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #URAT_VALUE | |
* @generated | |
* @ordered | |
*/ | |
URAT(11, "urat", "urat"), | |
/** | |
* The '<em><b>Urational</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #URATIONAL_VALUE | |
* @generated | |
* @ordered | |
*/ | |
URATIONAL(12, "urational", "urational"), | |
/** | |
* The '<em><b>Ufloat</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #UFLOAT_VALUE | |
* @generated | |
* @ordered | |
*/ | |
UFLOAT(13, "ufloat", "ufloat"), | |
/** | |
* The '<em><b>Udouble</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #UDOUBLE_VALUE | |
* @generated | |
* @ordered | |
*/ | |
UDOUBLE(14, "udouble", "udouble"), | |
/** | |
* The '<em><b>Ureal</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #UREAL_VALUE | |
* @generated | |
* @ordered | |
*/ | |
UREAL(15, "ureal", "ureal"), | |
/** | |
* The '<em><b>Char</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #CHAR_VALUE | |
* @generated | |
* @ordered | |
*/ | |
CHAR(16, "char", "char"), | |
/** | |
* The '<em><b>String</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #STRING_VALUE | |
* @generated | |
* @ordered | |
*/ | |
STRING(17, "string", "string"), | |
/** | |
* The '<em><b>Buffer</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #BUFFER_VALUE | |
* @generated | |
* @ordered | |
*/ | |
BUFFER(18, "buffer", "buffer"), | |
/** | |
* The '<em><b>Message</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #MESSAGE_VALUE | |
* @generated | |
* @ordered | |
*/ | |
MESSAGE(19, "message", "message"), | |
/** | |
* The '<em><b>Port</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #PORT_VALUE | |
* @generated | |
* @ordered | |
*/ | |
PORT(20, "port", "port"), | |
/** | |
* The '<em><b>Machine</b></em>' literal object. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #MACHINE_VALUE | |
* @generated | |
* @ordered | |
*/ | |
MACHINE(21, "machine", "machine"); | |
/** | |
* 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 | |
* @model name="boolean" | |
* @generated | |
* @ordered | |
*/ | |
public static final int BOOLEAN_VALUE = 0; | |
/** | |
* The '<em><b>Int</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Int</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #INT | |
* @model name="int" | |
* @generated | |
* @ordered | |
*/ | |
public static final int INT_VALUE = 1; | |
/** | |
* 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 | |
* @model name="integer" | |
* @generated | |
* @ordered | |
*/ | |
public static final int INTEGER_VALUE = 2; | |
/** | |
* The '<em><b>Rat</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Rat</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #RAT | |
* @model name="rat" | |
* @generated | |
* @ordered | |
*/ | |
public static final int RAT_VALUE = 3; | |
/** | |
* The '<em><b>Rational</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Rational</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #RATIONAL | |
* @model name="rational" | |
* @generated | |
* @ordered | |
*/ | |
public static final int RATIONAL_VALUE = 4; | |
/** | |
* The '<em><b>Float</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Float</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #FLOAT | |
* @model name="float" | |
* @generated | |
* @ordered | |
*/ | |
public static final int FLOAT_VALUE = 5; | |
/** | |
* 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 | |
* @model name="double" | |
* @generated | |
* @ordered | |
*/ | |
public static final int DOUBLE_VALUE = 6; | |
/** | |
* The '<em><b>Real</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Real</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #REAL | |
* @model name="real" | |
* @generated | |
* @ordered | |
*/ | |
public static final int REAL_VALUE = 7; | |
/** | |
* The '<em><b>Time</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Time</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #TIME | |
* @model name="time" | |
* @generated | |
* @ordered | |
*/ | |
public static final int TIME_VALUE = 8; | |
/** | |
* The '<em><b>Uint</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Uint</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #UINT | |
* @model name="uint" | |
* @generated | |
* @ordered | |
*/ | |
public static final int UINT_VALUE = 9; | |
/** | |
* The '<em><b>Uinteger</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Uinteger</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #UINTEGER | |
* @model name="uinteger" | |
* @generated | |
* @ordered | |
*/ | |
public static final int UINTEGER_VALUE = 10; | |
/** | |
* The '<em><b>Urat</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Urat</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #URAT | |
* @model name="urat" | |
* @generated | |
* @ordered | |
*/ | |
public static final int URAT_VALUE = 11; | |
/** | |
* The '<em><b>Urational</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Urational</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #URATIONAL | |
* @model name="urational" | |
* @generated | |
* @ordered | |
*/ | |
public static final int URATIONAL_VALUE = 12; | |
/** | |
* The '<em><b>Ufloat</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Ufloat</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #UFLOAT | |
* @model name="ufloat" | |
* @generated | |
* @ordered | |
*/ | |
public static final int UFLOAT_VALUE = 13; | |
/** | |
* The '<em><b>Udouble</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Udouble</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #UDOUBLE | |
* @model name="udouble" | |
* @generated | |
* @ordered | |
*/ | |
public static final int UDOUBLE_VALUE = 14; | |
/** | |
* The '<em><b>Ureal</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Ureal</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #UREAL | |
* @model name="ureal" | |
* @generated | |
* @ordered | |
*/ | |
public static final int UREAL_VALUE = 15; | |
/** | |
* The '<em><b>Char</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Char</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #CHAR | |
* @model name="char" | |
* @generated | |
* @ordered | |
*/ | |
public static final int CHAR_VALUE = 16; | |
/** | |
* 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 | |
* @model name="string" | |
* @generated | |
* @ordered | |
*/ | |
public static final int STRING_VALUE = 17; | |
/** | |
* The '<em><b>Buffer</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Buffer</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #BUFFER | |
* @model name="buffer" | |
* @generated | |
* @ordered | |
*/ | |
public static final int BUFFER_VALUE = 18; | |
/** | |
* The '<em><b>Message</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Message</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #MESSAGE | |
* @model name="message" | |
* @generated | |
* @ordered | |
*/ | |
public static final int MESSAGE_VALUE = 19; | |
/** | |
* The '<em><b>Port</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Port</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #PORT | |
* @model name="port" | |
* @generated | |
* @ordered | |
*/ | |
public static final int PORT_VALUE = 20; | |
/** | |
* The '<em><b>Machine</b></em>' literal value. | |
* <!-- begin-user-doc --> | |
* <p> | |
* If the meaning of '<em><b>Machine</b></em>' literal object isn't clear, | |
* there really should be more of a description here... | |
* </p> | |
* <!-- end-user-doc --> | |
* @see #MACHINE | |
* @model name="machine" | |
* @generated | |
* @ordered | |
*/ | |
public static final int MACHINE_VALUE = 21; | |
/** | |
* An array of all the '<em><b>Primitive Type Kind</b></em>' enumerators. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
private static final PrimitiveTypeKind[] VALUES_ARRAY = | |
new PrimitiveTypeKind[] { | |
BOOLEAN, | |
INT, | |
INTEGER, | |
RAT, | |
RATIONAL, | |
FLOAT, | |
DOUBLE, | |
REAL, | |
TIME, | |
UINT, | |
UINTEGER, | |
URAT, | |
URATIONAL, | |
UFLOAT, | |
UDOUBLE, | |
UREAL, | |
CHAR, | |
STRING, | |
BUFFER, | |
MESSAGE, | |
PORT, | |
MACHINE, | |
}; | |
/** | |
* A public read-only list of all the '<em><b>Primitive Type Kind</b></em>' enumerators. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static final List<PrimitiveTypeKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); | |
/** | |
* Returns the '<em><b>Primitive Type Kind</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 PrimitiveTypeKind get(String literal) { | |
for (int i = 0; i < VALUES_ARRAY.length; ++i) { | |
PrimitiveTypeKind result = VALUES_ARRAY[i]; | |
if (result.toString().equals(literal)) { | |
return result; | |
} | |
} | |
return null; | |
} | |
/** | |
* Returns the '<em><b>Primitive Type Kind</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 PrimitiveTypeKind getByName(String name) { | |
for (int i = 0; i < VALUES_ARRAY.length; ++i) { | |
PrimitiveTypeKind result = VALUES_ARRAY[i]; | |
if (result.getName().equals(name)) { | |
return result; | |
} | |
} | |
return null; | |
} | |
/** | |
* Returns the '<em><b>Primitive Type Kind</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 PrimitiveTypeKind get(int value) { | |
switch (value) { | |
case BOOLEAN_VALUE: return BOOLEAN; | |
case INT_VALUE: return INT; | |
case INTEGER_VALUE: return INTEGER; | |
case RAT_VALUE: return RAT; | |
case RATIONAL_VALUE: return RATIONAL; | |
case FLOAT_VALUE: return FLOAT; | |
case DOUBLE_VALUE: return DOUBLE; | |
case REAL_VALUE: return REAL; | |
case TIME_VALUE: return TIME; | |
case UINT_VALUE: return UINT; | |
case UINTEGER_VALUE: return UINTEGER; | |
case URAT_VALUE: return URAT; | |
case URATIONAL_VALUE: return URATIONAL; | |
case UFLOAT_VALUE: return UFLOAT; | |
case UDOUBLE_VALUE: return UDOUBLE; | |
case UREAL_VALUE: return UREAL; | |
case CHAR_VALUE: return CHAR; | |
case STRING_VALUE: return STRING; | |
case BUFFER_VALUE: return BUFFER; | |
case MESSAGE_VALUE: return MESSAGE; | |
case PORT_VALUE: return PORT; | |
case MACHINE_VALUE: return MACHINE; | |
} | |
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 PrimitiveTypeKind(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; | |
} | |
} //PrimitiveTypeKind |