public class ExpressionBuilder extends Object
Expression
instances. This class is the main API entrypoint. Users should create new
Expression
instances using this factory class.Constructor and Description |
---|
ExpressionBuilder(String expression)
Create a new ExpressionBuilder instance and initialize it with a given expression string.
|
Modifier and Type | Method and Description |
---|---|
Expression |
build()
Build the
Expression instance using the custom operators and functions set. |
ExpressionBuilder |
function(Function function)
Add a
Function implementation available for use in the expression |
ExpressionBuilder |
functions(Function... functions)
Add multiple
Function implementations available for use in the expression |
ExpressionBuilder |
functions(List<Function> functions)
Add multiple
Function implementations available for use in the expression |
ExpressionBuilder |
operator(List<Operator> operators)
Add multiple
Operator implementations which should be available for use in the expression |
ExpressionBuilder |
operator(Operator... operators)
Add multiple
Operator implementations which should be available for use in the expression |
ExpressionBuilder |
operator(Operator operator)
Add an
Operator which should be available for use in the expression |
ExpressionBuilder |
variable(String variableName) |
ExpressionBuilder |
variables(Set<String> variableNames) |
ExpressionBuilder |
variables(String... variableNames) |
public ExpressionBuilder(String expression)
expression
- the expression to be parsedpublic ExpressionBuilder function(Function function)
Function
implementation available for use in the expressionfunction
- the custom Function
implementation that should be available for use in the expression.public ExpressionBuilder functions(Function... functions)
Function
implementations available for use in the expressionfunctions
- the custom Function
implementationspublic ExpressionBuilder functions(List<Function> functions)
Function
implementations available for use in the expressionpublic ExpressionBuilder variables(Set<String> variableNames)
public ExpressionBuilder variables(String... variableNames)
public ExpressionBuilder variable(String variableName)
public ExpressionBuilder operator(Operator operator)
Operator
which should be available for use in the expressionoperator
- the custom Operator
to addpublic ExpressionBuilder operator(Operator... operators)
Operator
implementations which should be available for use in the expressionoperators
- the set of custom Operator
implementations to addpublic ExpressionBuilder operator(List<Operator> operators)
Operator
implementations which should be available for use in the expressionpublic Expression build()
Expression
instance using the custom operators and functions set.Expression
instance which can be used to evaluate the result of the expressionJas4pp 1.5 © Java Analysis Studio for Particle Physics