public final class TypeChecking
extends java.lang.Object
TypeChecking includes several functions which check the validity of connections e.g. functions that check if an object is a TrianaType or not and others which check if two units are compatible.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BYTE_ARRAY |
static java.lang.String |
DOUBLE_ARRAY |
static java.lang.String |
FLOAT_ARRAY |
static java.lang.String |
INT_ARRAY |
static java.lang.String |
LONG_ARRAY |
static java.lang.String |
SHORT_ARRAY |
Constructor and Description |
---|
TypeChecking() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Class |
classForTrianaType(java.lang.String name)
This function attempts to return the class representation for the the given name of the Triana type.
|
static java.lang.Class[] |
classForTrianaType(java.lang.String[] types)
Attempts to convert the array of objects (Strings actually) to TrianaTypes
|
static double[] |
floatArrayToDouble(float[] from) |
static boolean |
isCompatibility(java.lang.Class[] outTypes,
java.lang.Class[] inTypes)
Returns true if any of the specified types output is compatibale with any of the specified
input types.
|
static boolean |
isCompatibility(Node sendnode,
Node recnode)
Returns true if the specified nodes can be legitimately be connected.
|
static boolean |
isCompatible(java.lang.Object sentObject,
java.lang.Class[] inTypes)
Returns true if the specified object is one of the allowed input types.
|
public static final java.lang.String DOUBLE_ARRAY
public static final java.lang.String FLOAT_ARRAY
public static final java.lang.String LONG_ARRAY
public static final java.lang.String INT_ARRAY
public static final java.lang.String SHORT_ARRAY
public static final java.lang.String BYTE_ARRAY
public static boolean isCompatibility(java.lang.Class[] outTypes, java.lang.Class[] inTypes)
outTypes
- the types sent out from the output unit.inTypes
- the types allowed to be input to the input unit.public static boolean isCompatible(java.lang.Object sentObject, java.lang.Class[] inTypes)
sentObject
- the actual data object being sent.inTypes
- the types allowed to be input to the input unit.public static boolean isCompatibility(Node sendnode, Node recnode)
public static double[] floatArrayToDouble(float[] from)
public static java.lang.Class classForTrianaType(java.lang.String name)
public static java.lang.Class[] classForTrianaType(java.lang.String[] types)