org.stanwood.media.util
Class TextTable

java.lang.Object
  extended by org.stanwood.media.util.TextTable

public class TextTable
extends java.lang.Object

This class is used to render a table to text


Constructor Summary
TextTable(java.lang.String[] columnNames)
          The constructor
 
Method Summary
 void addRow(java.lang.String[] row)
          Used to add a row to the table.
protected  void printFooter(java.lang.StringBuilder buffer)
           
protected  void printHeader(java.lang.StringBuilder buffer)
           
protected  void printRow(java.lang.String[] row, java.lang.StringBuilder buffer)
           
protected  void printRows(java.lang.StringBuilder buffer)
           
 void printTable(java.lang.StringBuilder buffer)
          Used to print the table to a buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextTable

public TextTable(java.lang.String[] columnNames)
The constructor

Parameters:
columnNames - The names of the columns
Method Detail

addRow

public void addRow(java.lang.String[] row)
Used to add a row to the table. The number of values must be the same as the number of columns in the table.

Parameters:
row - The values in the row

printTable

public void printTable(java.lang.StringBuilder buffer)
Used to print the table to a buffer

Parameters:
buffer - The buffer

printFooter

protected void printFooter(java.lang.StringBuilder buffer)

printRows

protected void printRows(java.lang.StringBuilder buffer)

printRow

protected void printRow(java.lang.String[] row,
                        java.lang.StringBuilder buffer)

printHeader

protected void printHeader(java.lang.StringBuilder buffer)