Package util

Class Formulae

java.lang.Object
util.Formulae

public class Formulae extends Object
  • Field Details

    • expression

      private String expression
    • variable

      private String variable
    • validFormula

      private boolean validFormula
    • description

      private String description
  • Constructor Details

    • Formulae

      public Formulae(String expr)
  • Method Details

    • getExpression

      public String getExpression()
      Returns:
      the formula's expression i.e the quantity to the right of the equals sign.
    • setFormula

      public void setFormula(String expression)
      sets the formula or rather the expression( to the right of the equals sign ) to be equal to the parameter given below.
      Parameters:
      expression - the formula itself i.e the quantity to the right of the equals sign.
    • getVariable

      public String getVariable()
      Returns:
      the variable string that we set to be equal to the formula
    • setVariable

      public void setVariable(String variable)
      sets the variable name to the given value.
      Parameters:
      variable - the dependent variable that the formulae after evaluation will store its value in.
    • isValidFormula

      public boolean isValidFormula()
      Returns:
      returns true if the software can model a valid Formula object from the user's input
    • setValidFormula

      public void setValidFormula(boolean validFormula)
      Parameters:
      validFormula - set this to true if the software can model a valid Formula object from the user's input
    • getDescription

      public String getDescription()
      Returns:
      the description of the Formula
    • setDescription

      public void setDescription(String description)
      Sets the description of the Formula
      Parameters:
      description - the description of the Formulae
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      the String representaion of the Formulae object
    • parseFormulae

      private void parseFormulae(String formulae)