Interface DataTable

All Superinterfaces:
RenderableResult
All Known Implementing Classes:
DataTableBase, DataTableCsv, DataTableJson, DataTableText

public interface DataTable extends RenderableResult
A table displaying a series of DataTableCells.
  • Method Details

    • setCaption

      DataTable setCaption(String caption)
      Parameters:
      caption - The caption of the table. The caption row is hidden if no caption is set.
    • setExitCode

      DataTable setExitCode(ExitCode exitCode)
      Parameters:
      exitCode - indicates whether operation was successful or had any errors.
    • column

      DataTable column(String label, int preferredWidth)
      Adds a column to the table. All columns must be added before adding actual data.
      Parameters:
      label - the label of the column, used for human readable formats.
      preferredWidth - the preferred width in characters.
    • column

      DataTable column(DataTableColumn column)
      Adds a column to the table. All columns must be added before adding actual data.
      Parameters:
      column - the column definition.
    • row

      DataTable row(List<DataTableCell> dataPoints)
      Parameters:
      dataPoints - a series of cells which make up a row in the table.
    • row

      Creates a builder which will insert a row into the table when its build() method is called.
    • getColumns

      List<DataTableColumn> getColumns()
      Returns:
      all previously registered columns.
    • addFooter

      DataTable addFooter(String footer)
      Parameters:
      footer - a footer, e.g. a hint for a column label. Footers are only rendered in human readable formats.
    • addHorizontalRuler

      DataTable addHorizontalRuler()
      Add a horizontal ruler row at the current position.
    • setHideHeadersHint

      DataTable setHideHeadersHint(boolean hide)
      Parameters:
      hide - whether to hide column headers. This is just a hint and may be ignored depending on the output format.
    • setIndentHint

      DataTable setIndentHint(int hint)
      Parameters:
      hint - by how much to indent the rendered table. This is just a hint and may be ignored depending on the output format.
    • setLineWrapHint

      DataTable setLineWrapHint(boolean wrap)
      Parameters:
      wrap - whether overflow should be cut off or wrapped into an additional line in the table. This is just a hint and may be ignored depending on the output format.
    • setWordBreakHint

      DataTable setWordBreakHint(boolean allowBreak)
      Parameters:
      allowBreak - if true breaking words apart is allowed. If false (default) breaking words is only allowed if a single word cannot fit within a column.