Class TableInput

java.lang.Object
fr.project.lib.utility.TableInput

public final class TableInput extends Object
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 Details

    • data

      public final String[][] data
      The parsed data as a 2D String array [rows][columns]
    • col_label

      public final String[] col_label
      Array of column labels
    • w

      public final int w
      Width (number of columns) of the table
    • h

      public final int h
      Height (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

      public static TableInput parseTabSeparatedValues(InputStream is) throws IOException
      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

      public static TableInput parseCommaSeparatedValues(InputStream is) throws IOException
      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