Class Equation

java.lang.Object
fr.iMath.objects.Equation

public class Equation
extends java.lang.Object
Equation class
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.Stack<EquationObjectData> data
    All the ordered equation data
    private java.lang.String function  
    private java.lang.String prefix  
  • Constructor Summary

    Constructors 
    Constructor Description
    Equation​(java.lang.String function, java.lang.String prefix)
    Equation constructor
  • Method Summary

    Modifier and Type Method Description
    float evaluate​(float xValue)
    Evaluate the function with a specific x using the RPN Algorithm.
    java.lang.String getName()  

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • Equation

      public Equation​(java.lang.String function, java.lang.String prefix)
      Equation constructor
      Parameters:
      function - string function we need to convert
      prefix - prefix of the function (f(x), g(x), ...)
  • Method Details

    • evaluate

      public float evaluate​(float xValue)
      Evaluate the function with a specific x using the RPN Algorithm.
      Parameters:
      xValue - the x value
      Returns:
      a float
    • getName

      public java.lang.String getName()