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 algorithm
    private static boolean isLeftParenthesis​(EquationObjectData d)
    Return true if the EquationObjectData is a left parenthesis.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • convert

      public static java.util.Stack<EquationObjectData> convert​(java.util.List<EquationObjectData> list)
      Application of the Shunting-Yard algorithm
      Parameters:
      list - List of operators/functions which needs to be ordered
      Returns:
      ordered list of operators/functions
    • isLeftParenthesis

      private static boolean isLeftParenthesis​(EquationObjectData d)
      Return true if the EquationObjectData is a left parenthesis.
      Parameters:
      d - EquationObjectData
      Returns:
      true if the EquationObjectData is a left parenthesis.