Class TableFormatter

    • Constructor Detail

      • TableFormatter

        public TableFormatter()
    • Method Detail

      • clear

        public void clear()
        Clear.
      • content

        public TableFormatter content​(Collection<?> collection)
        Content table formatter.
        Parameters:
        collection - the collection
        Returns:
        the table formatter
      • header

        public <T> TableFormatter header​(Collection<? extends T> collection)
        Header table formatter.
        Parameters:
        collection - the collection
        Returns:
        the table formatter
      • print

        public void print​(PrintStream stream)
        Print the table to the give PrintStream .
        Parameters:
        stream - the print stream to write to
      • setMinCellWidth

        public void setMinCellWidth​(int cellWidth)
        Sets min cell width.
        Parameters:
        cellWidth - the cell width
      • setNumberFormatter

        public void setNumberFormatter​(DecimalFormat decimalFormat)
        Sets number formatter.
        Parameters:
        decimalFormat - the decimal format
      • title

        public TableFormatter title​(String title)
        Title table formatter.
        Parameters:
        title - the title
        Returns:
        the table formatter
      • write

        public Resource write​(Resource resource)
                       throws IOException
        Writes the table to a resource.
        Parameters:
        resource - the resource to write to
        Returns:
        the resource written to
        Throws:
        IOException - Something went wrong writing to the resource