public class FixedType extends Object implements FunctionTyper
Constructor and Description |
---|
FixedType(ScalarTokenType type)
Creates a typer which always returns the given 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 FixedType(ScalarTokenType type)
type
- the return type of the function. This
must not be an abstract type.IllegalArgumentException
- if the type is not a
valid return type for functionspublic 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 © 2021 Actian Corporation. All rights reserved.