Class TablePrinter

java.lang.Object
org.strassburger.subscriptionmanager.util.TablePrinter

public class TablePrinter extends Object
  • Constructor Details

    • TablePrinter

      public TablePrinter()
      Creates a new TablePrinter with no headers and no rows.
    • TablePrinter

      public TablePrinter(List<String> headers, List<List<String>> rows)
      Creates a new TablePrinter with the given headers and rows.
      Parameters:
      headers - The headers of the table.
      rows - The rows of the table.
  • Method Details

    • setHeaders

      public void setHeaders(List<String> headers)
      Sets the headers of the table.
    • setRows

      public void setRows(List<List<String>> rows)
      Sets the rows of the table.
    • addRow

      public void addRow(List<String> row)
      Adds a row to the table.
    • addRow

      public void addRow(int index, List<String> row)
      Adds a row to the table at the given index.
    • removeRow

      public void removeRow(int index)
      Removes a row from the table at the given index.
    • clearRows

      public void clearRows()
      Clears all rows from the table.
    • getHeaders

      public List<String> getHeaders()
    • getRows

      public List<List<String>> getRows()
    • getColumnWidths

      public List<Integer> getColumnWidths()
    • printTable

      public void printTable()