- 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 Summary
Constructors Constructor Description ReflectiveFactory(Class<? extends FunctionEvaluator> clazz)
Defines a factory creating evaluators of the specified class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FunctionEvaluator
contructEvaluator(ScalarSettable result, Object[] arguments)
Construct a new evaluator for the associated function with the given arguments, bound to the specified output buffer.
-
-
-
Constructor Detail
-
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 Detail
-
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 interfaceEvaluatorFactory
- Parameters:
result
- the buffer to which the function result is writtenarguments
- the arguments to the function- Returns:
- a new evaluator for the function
-
-