- java.lang.Object
-
- com.pervasive.datarush.functions.EvaluationContext
-
public class EvaluationContext extends Object
An object describing the context in which a subexpression of a larger expression is being evaluated. The context captures global information pertaining to the top-level expression containing the subexpression.
-
-
Constructor Summary
Constructors Constructor Description EvaluationContext(RecordValued input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionEvaluator
constructEvaluator(EvaluatorFactory factory, List<Object> arguments, ScalarSettable result)
Creates an evaluator for a top-level expression, binding its output to the provided result buffer.ScalarValued
constructSubexpressionEvaluation(EvaluatorFactory factory, List<Object> arguments, ScalarTokenType resultType)
Creates an evaluation of a subexpression which can be used as input to the evaluator of the expression containing it.FunctionEvaluator
createMemoizingEvaluator(FunctionEvaluator f)
Creates an evaluator for the top-level expression which memoizes subexpression values.RecordValued
getInput()
Gets the input record used for the top-level expression.
-
-
-
Constructor Detail
-
EvaluationContext
public EvaluationContext(RecordValued input)
-
-
Method Detail
-
getInput
public RecordValued getInput()
Gets the input record used for the top-level expression.- Returns:
-
createMemoizingEvaluator
public FunctionEvaluator createMemoizingEvaluator(FunctionEvaluator f)
Creates an evaluator for the top-level expression which memoizes subexpression values.- Parameters:
f
- the top-level evaluator- Returns:
- an evaluator caching intermediate results
-
constructEvaluator
public FunctionEvaluator constructEvaluator(EvaluatorFactory factory, List<Object> arguments, ScalarSettable result)
Creates an evaluator for a top-level expression, binding its output to the provided result buffer.- Parameters:
factory
- a factory for constructing the top-level functionarguments
- the arguments to pass to the function evaluatorresult
- the buffer into which evaluation results are to be written- Returns:
- a new evaluator
-
constructSubexpressionEvaluation
public ScalarValued constructSubexpressionEvaluation(EvaluatorFactory factory, List<Object> arguments, ScalarTokenType resultType)
Creates an evaluation of a subexpression which can be used as input to the evaluator of the expression containing it.- Parameters:
factory
- a factory for constructing the subexpression functionarguments
- the arguments to pass to the function evaluator- Returns:
- an object containing the current value of the subexpression
-
-