- java.lang.Object
-
- com.pervasive.datarush.functions.ObjectInputTyper
-
- All Implemented Interfaces:
FunctionTyper
public class ObjectInputTyper extends Object implements FunctionTyper
A typer determining the output type of a function based on the types of one or more Object inputs. If more than one input is used, the widest of the inputs is used.
-
-
Field Summary
Fields Modifier and Type Field Description static HashMap<Class<?>,ScalarTokenType>
typeTokenMap
-
Constructor Summary
Constructors Constructor Description ObjectInputTyper(int... indices)
ObjectInputTyper(ScalarTokenType bound, int... indices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScalarTokenType
computeResultType(FunctionContext ctx)
Calculates the result type for the function given the provided context.ScalarTokenType
computeUpperBound(FunctionContext ctx)
Calculates the upper bound for the function given the provided context.
-
-
-
Field Detail
-
typeTokenMap
public static HashMap<Class<?>,ScalarTokenType> typeTokenMap
-
-
Constructor Detail
-
ObjectInputTyper
public ObjectInputTyper(int... indices)
-
ObjectInputTyper
public ObjectInputTyper(ScalarTokenType bound, int... indices)
-
-
Method Detail
-
computeUpperBound
public ScalarTokenType computeUpperBound(FunctionContext ctx)
Description copied from interface:FunctionTyper
Calculates the upper bound for the function given the provided context.The context contains the upper bounds on the types of all arguments to the function. If a argument is not a subclass of
ScalarValuedFunction
, its type isnull
.- Specified by:
computeUpperBound
in interfaceFunctionTyper
- Parameters:
ctx
- the context of the function being processed- Returns:
- the upper bound on the function
-
computeResultType
public ScalarTokenType computeResultType(FunctionContext ctx)
Description copied from interface:FunctionTyper
Calculates the result type for the function given the provided context.The context contains the actual result types of all arguments to the function. If a argument is not a subclass of
ScalarValuedFunction
, its type isnull
.- Specified by:
computeResultType
in interfaceFunctionTyper
- Parameters:
ctx
- the context of the function being processed- Returns:
- the result type of the function
-
-