Class Table

    • Constructor Detail

      • Table

        public Table()
        Init a new Table.
      • Table

        public Table​(String format)
        Init a new Table with a format.
        Parameters:
        format - format of the table (tsv, csv, html)
    • Method Detail

      • addColumn

        public void addColumn​(Column column)
        Add a Column to the Table. This will be appended to the end of the current list of Columns.
        Parameters:
        column - Column to add.
      • addRow

        public void addRow​(Row row)
        Add a Row to the Table. This will be appended to the end of the current list of Rows.
        Parameters:
        row - Row to add
      • asWorkbook

        public org.apache.poi.ss.usermodel.Workbook asWorkbook​(String split)
        Render the Table as a Workbook.
        Parameters:
        split - character to split multiple cell values on
        Returns:
        Workbook
      • getDisplayRendererType

        public RendererType getDisplayRendererType()
        Get the type of display renderer
        Returns:
        RendererType
      • getSortRendererType

        public RendererType getSortRendererType()
        Get thee type of sort renderer
        Returns:
        RendererType
      • getColumns

        public List<Column> getColumns()
        Get the Columns in a Table.
        Returns:
        List of Columns
      • getFormat

        public String getFormat()
        Get the format of this table
        Returns:
        table format (csv, tsv, or html)
      • setSortColumns

        public void setSortColumns()
        Once all Columns have been added to a Table, set the columns to sort on. The columns should have consecutive sort order integers which will determine the order in which they are used to sort the Rows.
      • sortRows

        public void sortRows()
        Once all Rows have been added to a Table, sort Rows based on the sort Columns.
      • toList

        public List<String[]> toList​(String split)
        Render the Table as List of Arrays for writing to CSV/TSV.
        Parameters:
        split - String to split mulitple cell values on (default |)
        Returns:
        List of String[]
      • toHTML

        public String toHTML​(String split)
        Render the Table as an HTML string.
        Parameters:
        split - character to split multiple cell values on
        Returns:
        HTML string
      • toHTML

        public String toHTML​(String split,
                             boolean standalone)
        Render the Table as an HTML string.
        Parameters:
        split - character to split multiple cell values on
        standalone - if true, include header
        Returns:
        HTML string
      • toHTML

        public String toHTML​(String split,
                             boolean standalone,
                             boolean includeJS)
        Render the Table as an HTML string.
        Parameters:
        split - character to split multiple cell values on
        standalone - if true, include header
        includeJS - if true and standalone, include JS script for tooltips
        Returns:
        HTML string
      • toHTMLList

        public String toHTMLList()
      • toJSON

        public String toJSON()
        Render the Table as a JSON string.
        Returns:
        JSON string
      • toYAML

        public String toYAML()
                      throws IOException
        Render the Table as a YAML string.
        Returns:
        YAML string
        Throws:
        IOException - on issue writing to JSON tree
      • write

        public boolean write​(String path,
                             String split)
                      throws IOException
        Given a path and a split character, write the table to a path.
        Parameters:
        path - path to write to
        split - split character for multiple cell values
        Returns:
        true on success
        Throws:
        IOException - on any problem opening or writing file
      • write

        public boolean write​(String path,
                             String split,
                             boolean standalone)
                      throws IOException
        Given a path, a split character, and boolean if standalone, write the table to a path.
        Parameters:
        path - path to write to
        split - split character for multiple cell values
        standalone - if true, include HTML headers for HTML output
        Returns:
        true on success
        Throws:
        IOException - on any problem opening or writing file