Class ShuntingYard
java.lang.Object
net.objecthunter.exp4j.shuntingyard.ShuntingYard
Shunting yard implementation to convert infix to reverse polish notation
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ShuntingYard
public ShuntingYard()
-
-
Method Details
-
convertToRPN
public static Token[] convertToRPN(String expression, Map<String, Function> userFunctions, Map<String, Operator> userOperators, Set<String> variableNames, boolean implicitMultiplication) Convert a Set of tokens from infix to reverse polish notation- Parameters:
expression- the expression to convertuserFunctions- the custom functions useduserOperators- the custom operators usedvariableNames- the variable names used in the expressionimplicitMultiplication- set to false to turn off implicit multiplication- Returns:
- a
Tokenarray containing the result
-