public class ConversionUtilities
extends java.lang.Object
Token type Java type --------------------------------------------------- IntToken int DoubleToken double LongToken long StringToken java.lang.String BooleanToken boolean ComplexToken ptolemy.math.Complex FixToken ptolemy.math.FixPoint FixMatrixToken ptolemy.math.FixPoint[][] IntMatrixToken int[][] DoubleMatrixToken double[][] ComplexMatrixToken ptolemy.math.Complex[][] LongMatrixToken long[][] BooleanMatrixToken boolean[][] ArrayToken(FixToken) ptolemy.math.FixPoint[] ArrayToken(IntToken) int[] ArrayToken(LongToken) long[] ArrayToken(DoubleToken) double[] ArrayToken(ComplexToken) ptolemy.math.Complex[] ArrayToken(StringToken) java.lang.String[] ArrayToken(BooleanToken) boolean[] ArrayToken (*) Token[] --------------------------------------------------- (*) Only when converting from java to Token types
ASTPtRootNode
,
PtParser
,
Token
,
UtilityFunctions
,
Math
Constructor and Description |
---|
ConversionUtilities() |
Modifier and Type | Method and Description |
---|---|
static Token |
convertJavaTypeToToken(java.lang.Object object)
Convert a java object to a corresponding Token.
|
static Type |
convertJavaTypeToTokenType(java.lang.Class tokenClass)
Convert a java class, representing a Java type, to a
corresponding instance of a ptolemy type object, as consistent
with the convertJavaTypeToToken method.
|
static java.lang.Object |
convertTokenToJavaType(Token token)
Convert a Token to a corresponding Java object.
|
static java.lang.Class |
convertTokenTypeToJavaType(Type type)
Convert the given ptolemy type object to a java class
representing a java type.
|
public static Token convertJavaTypeToToken(java.lang.Object object) throws IllegalActionException
object
- The object that is a Java type to be converted.
The value of this parameter might be null, in which case an
ObjectToken with a null vIllegalActionException
- If the selected conversion fails.public static Type convertJavaTypeToTokenType(java.lang.Class tokenClass) throws IllegalActionException
tokenClass
- the java class to be converted.IllegalActionException
- If the token class is not
recognized, or creating the type fails.public static java.lang.Object convertTokenToJavaType(Token token) throws IllegalActionException
token
- The token to be converted.IllegalActionException
- If the selected conversion fails.public static java.lang.Class convertTokenTypeToJavaType(Type type) throws IllegalActionException
type
- the given type.IllegalActionException
- If the token class is not
recognized, or creating the type fails.