- evaluate(String) - Method in class tk.pratanumandal.expr4j.ExpressionEvaluator
-
Method to evaluate an expression.
This method acts as the single point of access for expression evaluation.
- evaluate(String) - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYard
-
Method to evaluate an expression.
This method should act as the single point of access for the implementation.
- evaluate(String) - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardDualStack
-
Method to evaluate an expression.
This method acts as the single point of access for expression evaluation.
- evaluate(ShuntingYardExpressionTree.Node) - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardExpressionTree
-
Method to recursively evaluate the expression tree and return the result as an operand.
- evaluate(String) - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardExpressionTree
-
Method to evaluate an expression.
This method acts as the single point of access for expression evaluation.
- evaluate(Operand...) - Method in interface tk.pratanumandal.expr4j.token.Function
-
Method invoked to evaluate the function.
- evaluate(Operand...) - Method in class tk.pratanumandal.expr4j.token.Operator
-
Method to evaluate this operator, function, variable, or constant.
It takes a variable number of operands as parameter depending on the number of operands required for this operator.
- evaluateExpr(String) - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardDualStack
-
Method to evaluate the expression string and return the result as an operand.
- evaluateParenthesis() - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardDualStack
-
Method to evaluate operators at the top of the operator stack until a left parenthesis is encountered.
- evaluateParenthesis() - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardExpressionTree
-
Method to evaluate operators at the top of the operator stack until a left parenthesis is encountered.
- evaluateTOS() - Method in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardDualStack
-
Method to evaluate the operator at the top of the operator stack.
- Expr4jConstants - Class in tk.pratanumandal.expr4j.common
-
The Expr4jConstants
class provides all the application wide constants.
- Expr4jException - Exception in tk.pratanumandal.expr4j.exception
-
The Expr4jException
class is the superclass of those exceptions that can be thrown during the execution of Expr4j library.
- Expr4jException() - Constructor for exception tk.pratanumandal.expr4j.exception.Expr4jException
-
Constructs a new expr4j exception with null as its detail message.
- Expr4jException(String, Throwable, boolean, boolean) - Constructor for exception tk.pratanumandal.expr4j.exception.Expr4jException
-
Constructs a new expr4j exception with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled.
- Expr4jException(String, Throwable) - Constructor for exception tk.pratanumandal.expr4j.exception.Expr4jException
-
Constructs a new expr4j exception with the specified detail message and cause.
- Expr4jException(String) - Constructor for exception tk.pratanumandal.expr4j.exception.Expr4jException
-
Constructs a new expr4j exception with the specified detail message.
- Expr4jException(Throwable) - Constructor for exception tk.pratanumandal.expr4j.exception.Expr4jException
-
Constructs a new expr4j exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause).
- ExpressionEvaluator - Class in tk.pratanumandal.expr4j
-
The ExpressionEvaluator
class is the logical entry point to the library.
It acts as a wrapper for shunting yard implementations allowing to easily choose the implementation to be used.
- ExpressionEvaluator() - Constructor for class tk.pratanumandal.expr4j.ExpressionEvaluator
-
No-argument constructor.
Use Dual Stack implementation of Shunting Yard as the default implementation.
- ExpressionEvaluator(ExpressionEvaluator.Evaluator) - Constructor for class tk.pratanumandal.expr4j.ExpressionEvaluator
-
Parameterized constructor.
Use the specified Shunting Yard implementation.
- ExpressionEvaluator.Evaluator - Enum in tk.pratanumandal.expr4j
-
The Evaluator
enum represents the Shunting Yard implementation to be used for evaluating expressions.
It can be of two types: DUAL_STACK, and EXPRESSION_TREE.
- Operand - Class in tk.pratanumandal.expr4j.token
-
The Operand
class represents the operands in the expression.
It acts as a wrapper for double value operands.
- Operand(String) - Constructor for class tk.pratanumandal.expr4j.token.Operand
-
Parameterized constructor.
- Operand(double) - Constructor for class tk.pratanumandal.expr4j.token.Operand
-
Parameterized constructor.
- operandStack - Variable in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardDualStack
-
Stack to hold the operands.
- Operator - Class in tk.pratanumandal.expr4j.token
-
The Operator
class represents the operators, functions, variables, and constants in the expression.
It provides implementation for evaluation of the operators, functions, variables, and constants.
Functions, variables, and constants are treated as operators as well with specialized evaluation techniques in order to maintain precedence and associativity.
- Operator(String) - Constructor for class tk.pratanumandal.expr4j.token.Operator
-
Parameterized constructor.
- Operator.Properties - Class in tk.pratanumandal.expr4j.token
-
The Properties
class represents the properties of an operator.
It contains information about the number of parameters supported, the precedence, and the associativity.
It also helps determine if an operator is a function or not and provides the function implementation.
- Operator.Properties.Associativity - Enum in tk.pratanumandal.expr4j.token
-
The Associativity
enum represents the associativity property of an operator.
It can be of three types: LEFT associative, RIGHT associative and NO associative.
- OperatorRepository - Class in tk.pratanumandal.expr4j
-
The OperatorRepository
class is the repository of all operators, functions, variables, and constants in the environment.
This class can be used to create user defined functions.
- OPERATORS - Static variable in class tk.pratanumandal.expr4j.OperatorRepository
-
A map of all operators, functions, variables, and constants supported.
- operatorStack - Variable in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardDualStack
-
Stack to hold the operators.
- operatorStack - Variable in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardExpressionTree
-
Stack to hold the operators.
- params - Variable in class tk.pratanumandal.expr4j.token.Operator.Properties
-
Number of parameters required by this operator.
- postfix - Variable in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardExpressionTree
-
Stack to hold the postfix (RPN) expression.
- precedence - Variable in class tk.pratanumandal.expr4j.token.Operator.Properties
-
The precedence of this operator.
Precedence ranges from 1 to infinity, in ascending order, i.e, with 1 being lowest precedence possible.
Although parenthesis and comma have 0 precedence, they are a special case and are evaluated separately.
- PRECISION - Static variable in class tk.pratanumandal.expr4j.common.Expr4jConstants
-
The maximum number of decimal places supported.
Currently this value is set to 10.
- PREDEFINED_OPERATORS - Static variable in class tk.pratanumandal.expr4j.OperatorRepository
-
A list of all predefined operators, functions, variables, and constants.
- Properties(int, int) - Constructor for class tk.pratanumandal.expr4j.token.Operator.Properties
-
Parameterized constructor taking number of parameters and precedence.
Associativity is set to LEFT and function is set to null.
- Properties(int, int, Operator.Properties.Associativity) - Constructor for class tk.pratanumandal.expr4j.token.Operator.Properties
-
Parameterized constructor taking number of parameters, precedence, and associativity.
Function is set to null.
- Properties(int, int, Function) - Constructor for class tk.pratanumandal.expr4j.token.Operator.Properties
-
Parameterized constructor taking number of parameters, precedence, and function.
If function is not null, associativity is set to NO, otherwise LEFT.
- Properties(int, int, Operator.Properties.Associativity, Function) - Constructor for class tk.pratanumandal.expr4j.token.Operator.Properties
-
Parameterized constructor taking number of parameters, precedence, associativity, and function.
It is recommended not to use this constructor, instead using one of the preset constructors if possible.
- tk.pratanumandal.expr4j - package tk.pratanumandal.expr4j
-
The tk.pratanumandal.expr4j
package is the root package of expr4j library.
- tk.pratanumandal.expr4j.common - package tk.pratanumandal.expr4j.common
-
The tk.pratanumandal.expr4j.common
package is a group of constants and common utils.
- tk.pratanumandal.expr4j.exception - package tk.pratanumandal.expr4j.exception
-
The tk.pratanumandal.expr4j.exception
package contains all exception classes related to Expr4j library.
- tk.pratanumandal.expr4j.shuntingyard - package tk.pratanumandal.expr4j.shuntingyard
-
The tk.pratanumandal.expr4j.shuntingyard
package contains Shunting Yard implementations for expression evaluation.
- tk.pratanumandal.expr4j.token - package tk.pratanumandal.expr4j.token
-
The tk.pratanumandal.expr4j.token
package contains all the tokens that form an expression.
- toDouble() - Method in class tk.pratanumandal.expr4j.token.Operand
-
Convert operand String to double.
- token - Variable in class tk.pratanumandal.expr4j.shuntingyard.ShuntingYardExpressionTree.Node
-
Token contained in this node.
A token can be an operand, operator, function, variable, or constant.
- Token - Class in tk.pratanumandal.expr4j.token
-
The Token
class represents any token in expressions.
A token is the smallest indivisible unit of any expression.
Tokens can be operands, operators, functions, variables, or constants.
- Token(String) - Constructor for class tk.pratanumandal.expr4j.token.Token
-
Parameterized constructor.
- toString() - Method in class tk.pratanumandal.expr4j.token.Token
-
Method to convert token object to string.