Class TablePrinter
java.lang.Object
fc.io.TablePrinter
Prints a table formatted using plain text/ascii characters.
Useful for console based output and/or formatted output to a
file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration object containing for table printing object. -
Constructor Summary
ConstructorsConstructorDescriptionTablePrinter(int columnCount, PrintStream ps, TablePrinter.PrintConfig config) Constructs a new table printer.TablePrinter(int columnCount, PrintWriter pw, TablePrinter.PrintConfig config) Constructs a new table printer. -
Method Summary
Modifier and TypeMethodDescriptionvoidendRow()This method should be called to finish the existing rowvoidendTable()This method should be called to finish the tablestatic voidvoidThis method should be called to print a new cell in the current row.voidstartRow()This method should be called to start a new rowvoidThis method should be called to start the tabletoString()
-
Constructor Details
-
TablePrinter
Constructs a new table printer.- Parameters:
columnCount- the number of columns in the table. Attemps to print more than these number of columns will result in a runtime exception.config- the printing configurationpw- the destination print stream
-
TablePrinter
Constructs a new table printer.- Parameters:
columnCount- the number of columns in the table. Attemps to print more than these number of columns will result in a runtime exception.pw- the destination print writerconfig- the printing configuration
-
-
Method Details
-
startTable
This method should be called to start the table -
endTable
This method should be called to finish the table -
startRow
This method should be called to start a new row -
endRow
This method should be called to finish the existing row -
printCell
-
toString
-
main
-