Class ReflectiveFactory

java.lang.Object
com.pervasive.datarush.functions.ReflectiveFactory
All Implemented Interfaces:
EvaluatorFactory

public class ReflectiveFactory extends Object implements EvaluatorFactory
A factory creating a fixed class of function evaluator. Construction is done via reflection. To be usable with this factory, the evaluator class must:
  • Define a single constructor.
  • Take a ScalarSettable or subclass object as the first argument as the result buffer.
  • Take the function arguments in the order they were declared in the function description. (ScalarFunctionDescriptor. Varargs are supported with either an array (or vararg) or list as the last argument.
  • Constructor Details

    • ReflectiveFactory

      public ReflectiveFactory(Class<? extends FunctionEvaluator> clazz)
      Defines a factory creating evaluators of the specified class.
      Parameters:
      evaluator - the class of the evaluator to create
  • Method Details

    • contructEvaluator

      public FunctionEvaluator contructEvaluator(ScalarSettable result, Object[] arguments)
      Description copied from interface: EvaluatorFactory
      Construct a new evaluator for the associated function with the given arguments, bound to the specified output buffer.
      Specified by:
      contructEvaluator in interface EvaluatorFactory
      Parameters:
      result - the buffer to which the function result is written
      arguments - the arguments to the function
      Returns:
      a new evaluator for the function