public class TablePrinter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TablePrinter.PrintConfig
Configuration object containing for table printing object.
|
Constructor and Description |
---|
TablePrinter(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.
|
Modifier and Type | Method and Description |
---|---|
void |
endRow()
This method should be called to finish the existing row
|
void |
endTable()
This method should be called to finish the table
|
static void |
main(String[] args) |
void |
printCell(String str)
This method should be called to print a new cell in the
current row.
|
void |
startRow()
This method should be called to start a new row
|
void |
startTable()
This method should be called to start the table
|
String |
toString() |
public TablePrinter(int columnCount, PrintStream ps, TablePrinter.PrintConfig config)
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 streamconfig
- the printing configurationpublic TablePrinter(int columnCount, PrintWriter pw, TablePrinter.PrintConfig config)
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 configurationpublic void startTable()
public void endTable()
public void startRow()
public void endRow()
public void printCell(String str)