Class TablePrinter<T>


  • public class TablePrinter<T>
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  TablePrinter.Header<T>  
    • Constructor Summary

      Constructors 
      Constructor Description
      TablePrinter()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TablePrinter<T> add​(java.util.Collection<? extends T> rows)  
      TablePrinter<T> add​(T row)  
      TablePrinter<T> add​(T row, T... more)  
      void build​(java.lang.StringBuilder buf)  
      void clearRows()  
      TablePrinter<T> header​(java.lang.String name, java.util.function.Function<T,​java.lang.String> supplier)  
      TablePrinter<T> header​(java.lang.String name, java.util.function.Function<T,​java.lang.String> supplier, boolean right)  
      private static void line​(java.lang.StringBuilder buf, int size)  
      private static void pad​(java.lang.StringBuilder buf, int size)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • rows

        private final java.util.List<T> rows
    • Constructor Detail

      • TablePrinter

        public TablePrinter()
    • Method Detail

      • header

        public TablePrinter<T> header​(java.lang.String name,
                                      java.util.function.Function<T,​java.lang.String> supplier)
      • header

        public TablePrinter<T> header​(java.lang.String name,
                                      java.util.function.Function<T,​java.lang.String> supplier,
                                      boolean right)
      • clearRows

        public void clearRows()
      • add

        public TablePrinter<T> add​(java.util.Collection<? extends T> rows)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • build

        public void build​(java.lang.StringBuilder buf)
      • line

        private static void line​(java.lang.StringBuilder buf,
                                 int size)
      • pad

        private static void pad​(java.lang.StringBuilder buf,
                                int size)