java.lang.Object
com.pervasive.datarush.functions.FixedType
- All Implemented Interfaces:
FunctionTyper
A typer for functions which return a fixed, known type.
-
Constructor Summary
ConstructorsConstructorDescriptionFixedType(ScalarTokenType type) Creates a typer which always returns the given type. -
Method Summary
Modifier and TypeMethodDescriptionCalculates the result type for the function given the provided context.Calculates the upper bound for the function given the provided context.
-
Constructor Details
-
FixedType
Creates a typer which always returns the given type.- Parameters:
type- the return type of the function. This must not be an abstract type.- Throws:
IllegalArgumentException- if the type is not a valid return type for functions
-
-
Method Details
-
computeUpperBound
Description copied from interface:FunctionTyperCalculates 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:
computeUpperBoundin interfaceFunctionTyper- Parameters:
ctx- the context of the function being processed- Returns:
- the upper bound on the function
-
computeResultType
Description copied from interface:FunctionTyperCalculates 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:
computeResultTypein interfaceFunctionTyper- Parameters:
ctx- the context of the function being processed- Returns:
- the result type of the function
-