Class TartagliaExpressionParser

java.lang.Object
math.tartaglia.TartagliaExpressionParser

public class TartagliaExpressionParser
extends java.lang.Object
Author:
JIBOYE OLuwagbemiro Olaoluwa
  • Constructor Summary

    Constructors 
    Constructor Description
    TartagliaExpressionParser​(java.lang.String expression)  
  • Method Summary

    Modifier and Type Method Description
    void appendOneToStartOfFreeVariables()
    When the situation x+2y+z=9; is met, this method will convert it into 1.0x+2y+z=9;
    void doArithmetic()
    This method initializes the coefficients field with the coefficient of Xsquared at index 0 the coefficient of X at index 1 the coefficient of the constant term at index 2
    void freeWhiteSpaces()
    removes white space from the ArrayList
    java.util.ArrayList<java.lang.Double> getCoefficients()  
    java.lang.String getExpression()  
    java.util.ArrayList<java.lang.String> getScanner()  
    java.lang.String getUnknown()  
    java.lang.String interpretedSystem()  
    boolean isValid()  
    static void main​(java.lang.String[] args)  
    void recognizeCompoundVariables()
    turns the Xsquare into a single variable.
    void recognizeNegativesAndPositives()  
    void setExpression​(java.lang.String expression)  
    void setScanner​(java.util.ArrayList<java.lang.String> scanner)  
    void setValid​(boolean valid)  
    void validateChars()
    Checks the character set of this parser.
    void validateEqualsSymbol()  
    void validateNumbers()
    Checks the left and right of a number to see if the appropriate items are the ones there.
    void validateVars()
    Checks if the variables are properly arranged wrt other tokens.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getCoefficients

      public java.util.ArrayList<java.lang.Double> getCoefficients()
      Returns:
      the coefficients ArrayList object.
    • freeWhiteSpaces

      public void freeWhiteSpaces()
      removes white space from the ArrayList
    • setValid

      public void setValid​(boolean valid)
    • isValid

      public boolean isValid()
    • setScanner

      public void setScanner​(java.util.ArrayList<java.lang.String> scanner)
    • getScanner

      public java.util.ArrayList<java.lang.String> getScanner()
    • setExpression

      public void setExpression​(java.lang.String expression)
    • getExpression

      public java.lang.String getExpression()
    • appendOneToStartOfFreeVariables

      public void appendOneToStartOfFreeVariables()
      When the situation x+2y+z=9; is met, this method will convert it into 1.0x+2y+z=9;
    • validateEqualsSymbol

      public void validateEqualsSymbol()
    • validateChars

      public void validateChars()
      Checks the character set of this parser.
    • validateVars

      public void validateVars()
      Checks if the variables are properly arranged wrt other tokens.
    • validateNumbers

      public void validateNumbers()
      Checks the left and right of a number to see if the appropriate items are the ones there. It is a syntax error if an invalid item is found there
    • recognizeNegativesAndPositives

      public void recognizeNegativesAndPositives()
    • recognizeCompoundVariables

      public void recognizeCompoundVariables()
      turns the Xsquare into a single variable.
    • getUnknown

      public java.lang.String getUnknown()
      Returns:
      the name of the unknown.
    • doArithmetic

      public void doArithmetic()
      This method initializes the coefficients field with the coefficient of Xsquared at index 0 the coefficient of X at index 1 the coefficient of the constant term at index 2
    • interpretedSystem

      public java.lang.String interpretedSystem()
      Returns:
      the reduced form of the system in the form Ax³+Bx+C=0;
    • main

      public static void main​(java.lang.String[] args)