Package fr.iMath.algorithms
Class ShuntingYardAlgorithm
java.lang.Object
fr.iMath.algorithms.ShuntingYardAlgorithm
public class ShuntingYardAlgorithm
extends java.lang.Object
Application of the Shunting-Yard algorithm
- Author:
- HESEQUE Antoine
- See Also:
- ShuntingYard algorithm from Wikipedia
-
Constructor Summary
Constructors Constructor Description ShuntingYardAlgorithm()
-
Method Summary
Modifier and Type Method Description static java.util.Stack<EquationObjectData>
convert(java.util.List<EquationObjectData> list)
Application of the Shunting-Yard algorithmprivate static boolean
isLeftParenthesis(EquationObjectData d)
Return true if the EquationObjectData is a left parenthesis.
-
Constructor Details
-
ShuntingYardAlgorithm
public ShuntingYardAlgorithm()
-
-
Method Details
-
convert
Application of the Shunting-Yard algorithm- Parameters:
list
- List of operators/functions which needs to be ordered- Returns:
- ordered list of operators/functions
-
isLeftParenthesis
Return true if the EquationObjectData is a left parenthesis.- Parameters:
d
- EquationObjectData- Returns:
- true if the EquationObjectData is a left parenthesis.
-