public class WidestInputTyper extends Object implements FunctionTyper
Constructor and Description |
---|
WidestInputTyper(int... indices)
Defines a type using the specified inputs to determine
the output type.
|
WidestInputTyper(ScalarTokenType bound,
int... indices)
Defines a type using the specified inputs to determine
the output type.
|
Modifier and Type | Method and 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.
|
public WidestInputTyper(int... indices)
indices
- the input arguments to use to determine type.
If none are supplied, all arguments are used.public WidestInputTyper(ScalarTokenType bound, int... indices)
ScalarFunctionDescriptor
.bound
- the upper bound for the functionindices
- the input arguments to use to determine type.
If none are supplied, all arguments are used.public ScalarTokenType computeUpperBound(FunctionContext ctx)
FunctionTyper
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
is null
.
computeUpperBound
in interface FunctionTyper
ctx
- the context of the function being processedpublic ScalarTokenType computeResultType(FunctionContext ctx)
FunctionTyper
The context contains the actual result types of
all arguments to the function. If a argument is not
a subclass of ScalarValuedFunction
, its type
is null
.
computeResultType
in interface FunctionTyper
ctx
- the context of the function being processedCopyright © 2020 Actian Corporation. All rights reserved.