Class GridExpressionParser

java.lang.Object
com.github.gbenroscience.math.graph.GridExpressionParser

public class GridExpressionParser extends Object
Objects of this class take a compound plot instruction, scan it into all smaller plot instructions, and then analyze each instruction to determine its type. They store a record of each smaller plot instruction in an ArrayList of GraphElement objects
Author:
JIBOYE Oluwagbemiro Olaoluwa
  • Field Details

    • lock

      public final Object lock
  • Constructor Details

  • Method Details

    • setInput

      public void setInput(String input, Grid.GraphDataSharer dataSharer)
    • getInput

      public String getInput()
    • setCanPlot

      public void setCanPlot(boolean canPlot)
    • isCanPlot

      public boolean isCanPlot()
    • determineType

      public static GraphType determineType(String input) throws NullPointerException
      Parameters:
      input - The input plot instruction.
      Returns:
      the type of GraphType that input represents.
      Throws:
      NullPointerException
    • setGraphElements

      public void setGraphElements(ArrayList<GraphElement> graphElements)
    • getGraphElements

      public ArrayList<GraphElement> getGraphElements()
    • getFirstFunctionPlotTypeGraphElement

      public GraphElement getFirstFunctionPlotTypeGraphElement()
      Returns:
      the first GraphElement that is of type GraphType.FunctionPlot
    • addFunctions

      public void addFunctions(GridExpressionParser gep)
      Parameters:
      gep - Another GridExpressionParser object. Appends the function definitions in the other GridExpressionParser object to the functions in this one.
    • scan

      public final void scan(Grid.GraphDataSharer dataSharer)
      Isolates each complete plottable instruction.
      Parameters:
      dataSharer -