Class 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 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 function
        arguments - the arguments to pass to the function evaluator
        result - 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 function
        arguments - the arguments to pass to the function evaluator
        Returns:
        an object containing the current value of the subexpression