Class DrillParser

java.lang.Object
org.emrick.project.DrillParser

public class DrillParser extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    extractText(String fileName)
    Takes in a pdf filename and returns the raw text from the document
    private static double
    getX(String line)
    Takes in a line of drill data and returns the specified x-coordinate
    private static double
    getY(String line)
    Takes in a line of drill data and returns the specified y-coordinate
    static Drill
    importDrill(String filename)
    Takes in a file name, reads from the 2 files with that name and creates a drill object from the files
    static Performer
    parseDrill(String text, Drill drill, int id)
    Takes in the raw text data for the drill of a single performer, loads the coordinated into the drill object, and returns a performer object.
    static Drill
    Takes in the text from an entire drill file and returns the data from this file in a single drill object

    Methods inherited from class java.lang.Object

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

    • DrillParser

      public DrillParser()
  • Method Details

    • extractText

      public static String extractText(String fileName)
      Takes in a pdf filename and returns the raw text from the document
      Parameters:
      fileName - PDF file path
      Returns:
      Raw text from the pdf
    • importDrill

      public static Drill importDrill(String filename)
      Takes in a file name, reads from the 2 files with that name and creates a drill object from the files
      Parameters:
      filename - Prefix for the 2 files (for input "test" files would be testPerformers.json and testCoordinates.json)
      Returns:
      Drill object TODO: Modify this function and Drill.saveDrill to write a single compressed rather than 2 files
    • parseWholeDrill

      public static Drill parseWholeDrill(String text)
      Takes in the text from an entire drill file and returns the data from this file in a single drill object
      Parameters:
      text - raw text drill data
      Returns:
      Drill object
    • parseDrill

      public static Performer parseDrill(String text, Drill drill, int id)
      Takes in the raw text data for the drill of a single performer, loads the coordinated into the drill object, and returns a performer object.
      Parameters:
      text - Raw text drill data for a single performer
      drill - Drill object
      id - ID for new Performer object
      Returns:
      newly created Performer object
    • getX

      private static double getX(String line)
      Takes in a line of drill data and returns the specified x-coordinate
      Parameters:
      line - 1 line of raw text drill data
      Returns:
      x-coordinate
    • getY

      private static double getY(String line)
      Takes in a line of drill data and returns the specified y-coordinate
      Parameters:
      line - 1 line of raw text drill data
      Returns:
      y-coordinate