jhplot.math.exp4j
Class ExpressionBuilder
- java.lang.Object
-
- jhplot.math.exp4j.ExpressionBuilder
-
public class ExpressionBuilder extends java.lang.Object
Factory class forExpression
instances. This class is the main API entrypoint. Users should create newExpression
instances using this factory class.
-
-
Constructor Summary
Constructors Constructor and Description ExpressionBuilder(java.lang.String expression)
Create a new ExpressionBuilder instance and initialize it with a given expression string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Expression
build()
Build theExpression
instance using the custom operators and functions set.ExpressionBuilder
function(Function function)
Add aFunction
implementation available for use in the expressionExpressionBuilder
functions(Function... functions)
Add multipleFunction
implementations available for use in the expressionExpressionBuilder
functions(java.util.List<Function> functions)
Add multipleFunction
implementations available for use in the expressionExpressionBuilder
operator(java.util.List<Operator> operators)
Add multipleOperator
implementations which should be available for use in the expressionExpressionBuilder
operator(Operator... operators)
Add multipleOperator
implementations which should be available for use in the expressionExpressionBuilder
operator(Operator operator)
Add anOperator
which should be available for use in the expressionExpressionBuilder
variable(java.lang.String variableName)
ExpressionBuilder
variables(java.util.Set<java.lang.String> variableNames)
ExpressionBuilder
variables(java.lang.String... variableNames)
-
-
-
Constructor Detail
-
ExpressionBuilder
public ExpressionBuilder(java.lang.String expression)
Create a new ExpressionBuilder instance and initialize it with a given expression string.- Parameters:
expression
- the expression to be parsed
-
-
Method Detail
-
function
public ExpressionBuilder function(Function function)
Add aFunction
implementation available for use in the expression- Parameters:
function
- the customFunction
implementation that should be available for use in the expression.- Returns:
- the ExpressionBuilder instance
-
functions
public ExpressionBuilder functions(Function... functions)
Add multipleFunction
implementations available for use in the expression- Parameters:
functions
- the customFunction
implementations- Returns:
- the ExpressionBuilder instance
-
functions
public ExpressionBuilder functions(java.util.List<Function> functions)
Add multipleFunction
implementations available for use in the expression- Parameters:
functions
- AList
of customFunction
implementations- Returns:
- the ExpressionBuilder instance
-
variables
public ExpressionBuilder variables(java.util.Set<java.lang.String> variableNames)
-
variables
public ExpressionBuilder variables(java.lang.String... variableNames)
-
variable
public ExpressionBuilder variable(java.lang.String variableName)
-
operator
public ExpressionBuilder operator(Operator operator)
Add anOperator
which should be available for use in the expression- Parameters:
operator
- the customOperator
to add- Returns:
- the ExpressionBuilder instance
-
operator
public ExpressionBuilder operator(Operator... operators)
Add multipleOperator
implementations which should be available for use in the expression- Parameters:
operators
- the set of customOperator
implementations to add- Returns:
- the ExpressionBuilder instance
-
operator
public ExpressionBuilder operator(java.util.List<Operator> operators)
Add multipleOperator
implementations which should be available for use in the expression- Parameters:
operators
- theList
of customOperator
implementations to add- Returns:
- the ExpressionBuilder instance
-
build
public Expression build()
Build theExpression
instance using the custom operators and functions set.- Returns:
- an
Expression
instance which can be used to evaluate the result of the expression
-
-
DMelt 3.0 © DataMelt by jWork.ORG