Class TextTabularOutput

  • All Implemented Interfaces:
    LogOutputter

    public class TextTabularOutput
    extends java.lang.Object
    implements LogOutputter
    Utility class to wrap a DataExporter so column widths can be computed on-the-fly by buffering first 1000 results and inspecting values.
    Author:
    Evren Sirin*
    • Constructor Summary

      Constructors 
      Constructor Description
      TextTabularOutput​(com.brsanthu.dataexporter.DataExporter theExporter, java.lang.Iterable<com.brsanthu.dataexporter.model.Column> theColumns)  
      TextTabularOutput​(java.io.OutputStream theOut, com.brsanthu.dataexporter.model.Column... theColumns)  
      TextTabularOutput​(java.io.OutputStream theOut, java.lang.Iterable<com.brsanthu.dataexporter.model.Column> theColumns)  
      TextTabularOutput​(java.io.OutputStream theOut, java.lang.String... theColNames)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRow​(java.lang.Object... theRow)  
      com.brsanthu.dataexporter.model.Column getColumn​(int index)  
      java.util.List<com.brsanthu.dataexporter.model.Column> getColumns()  
      int getMaxColWidth()
      Returns the maximum column width.
      int getMinColWidth()
      Returns the minimum column width.
      int getPrefetchLimit()  
      long output()  
      void setMaxColWidth​(int theMaxColWidth)
      Sets the maximum column width.
      void setMinColWidth​(int theMinColWidth)
      Sets the minimum column width.
      void setPrefetchLimit​(int thePrefetchLimit)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextTabularOutput

        public TextTabularOutput​(java.io.OutputStream theOut,
                                 java.lang.String... theColNames)
      • TextTabularOutput

        public TextTabularOutput​(java.io.OutputStream theOut,
                                 com.brsanthu.dataexporter.model.Column... theColumns)
      • TextTabularOutput

        public TextTabularOutput​(java.io.OutputStream theOut,
                                 java.lang.Iterable<com.brsanthu.dataexporter.model.Column> theColumns)
      • TextTabularOutput

        public TextTabularOutput​(com.brsanthu.dataexporter.DataExporter theExporter,
                                 java.lang.Iterable<com.brsanthu.dataexporter.model.Column> theColumns)
    • Method Detail

      • addRow

        public void addRow​(java.lang.Object... theRow)
        Specified by:
        addRow in interface LogOutputter
      • getPrefetchLimit

        public int getPrefetchLimit()
      • getMinColWidth

        public int getMinColWidth()
        Returns the minimum column width.
      • setMinColWidth

        public void setMinColWidth​(int theMinColWidth)
        Sets the minimum column width.
      • getMaxColWidth

        public int getMaxColWidth()
        Returns the maximum column width.
      • setMaxColWidth

        public void setMaxColWidth​(int theMaxColWidth)
        Sets the maximum column width.
      • getColumn

        public com.brsanthu.dataexporter.model.Column getColumn​(int index)
      • getColumns

        public java.util.List<com.brsanthu.dataexporter.model.Column> getColumns()