Package fr.project.lib.utility
Class TableInput
java.lang.Object
fr.project.lib.utility.TableInput
A utility class for parsing tabular data from CSV/TSV files into a structured format.
Uses ANTLR parsers for robust parsing of delimited text files.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidfill()Fills empty cells in the table with default values: - Empty column labels become "colN" - Empty data cells become ""static TableInputParses comma-separated values from an input streamstatic TableInputParses tab-separated values from an input stream
-
Field Details
-
data
The parsed data as a 2D String array [rows][columns] -
col_label
Array of column labels -
w
public final int wWidth (number of columns) of the table -
h
public final int hHeight (number of rows) of the table
-
-
Method Details
-
fill
public void fill()Fills empty cells in the table with default values: - Empty column labels become "colN" - Empty data cells become "" -
parseTabSeparatedValues
Parses tab-separated values from an input stream- Parameters:
is- The input stream containing TSV data- Returns:
- TableInput containing parsed data
- Throws:
IOException- If there's an error reading the stream
-
parseCommaSeparatedValues
Parses comma-separated values from an input stream- Parameters:
is- The input stream containing CSV data- Returns:
- TableInput containing parsed data
- Throws:
IOException- If there's an error reading the stream
-