Package org.emrick.project
Class DrillParser
java.lang.Object
org.emrick.project.DrillParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
extractText
(String fileName) Takes in a pdf filename and returns the raw text from the documentprivate static double
Takes in a line of drill data and returns the specified x-coordinateprivate static double
Takes in a line of drill data and returns the specified y-coordinatestatic Drill
importDrill
(String filename) Takes in a file name, reads from the 2 files with that name and creates a drill object from the filesstatic 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
parseWholeDrill
(String text) Takes in the text from an entire drill file and returns the data from this file in a single drill object
-
Constructor Details
-
DrillParser
public DrillParser()
-
-
Method Details
-
extractText
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
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
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
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 performerdrill
- Drill objectid
- ID for new Performer object- Returns:
- newly created Performer object
-
getX
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
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
-