Package com.github.basking2.sdsai.itrex
Class Evaluator
java.lang.Object
com.github.basking2.sdsai.itrex.Evaluator
-
Constructor Summary
ConstructorDescriptionBuild an evaluator, importing most of the basic packages of functions.Construct a new evaluator and import the default functions.Evaluator
(Executor executor, EvaluationContext rootContext) This constructor only assigns the arguments to the internal state of this instance. -
Method Summary
Modifier and TypeMethodDescriptionCreate a default, empty, evaluation context and callevaluate(Object, EvaluationContext)
.evaluate
(Object o, EvaluationContext context) void
Import the base functions, help, version and import.void
Used by constructors, this imports the default libraries.void
register
(Object name, FunctionInterface<? extends Object> operator)
-
Constructor Details
-
Evaluator
Construct a new evaluator and import the default functions.- Parameters:
executor
- An executor to use for parallelism.
-
Evaluator
public Evaluator()Build an evaluator, importing most of the basic packages of functions. -
Evaluator
This constructor only assigns the arguments to the internal state of this instance. This does no initialization. If you want an emptyEvaluator
, use this constructor.- Parameters:
executor
- How concurrency is managed.rootContext
- The root context.- See Also:
-
-
Method Details
-
importBase
public void importBase()Import the base functions, help, version and import. -
importDefaults
public void importDefaults()Used by constructors, this imports the default libraries. -
register
-
evaluate
Create a default, empty, evaluation context and callevaluate(Object, EvaluationContext)
.- Parameters:
o
- The object to evaluate.- Returns:
- The result of the evaluation.
-
evaluate
-
evaluate
-
getRootEvaluationContext
-
getChildEvaluationContext
-