|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.faban.common.TextTable
public class TextTable
The text table assists in formatting tabular data for text output. I takes care of column alignments. The output format is compatible with FenXi's Xan format.
| Constructor Summary | |
|---|---|
TextTable(int rows,
int columns)
Constructs a text table with predefined number of rows and columns. |
|
| Method Summary | |
|---|---|
Appendable |
format(Appendable a)
Formats the TextTable and outputs to an Appendable. |
StringBuffer |
format(StringBuffer b)
StringBuffer version of format. |
StringBuilder |
format(StringBuilder b)
StringBuilder version of format. |
CharSequence |
getField(int row,
int column)
Obtains the field so formatters can insert values directly. |
CharSequence |
getHeader(int column)
Gets the header field's value. |
void |
setField(int row,
int column,
CharSequence field)
Sets the data fields' value. |
void |
setHeader(int column,
CharSequence header)
Sets the header fields' value. |
String |
toString()
Returns the formatted table in a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TextTable(int rows,
int columns)
rows - The number of rowscolumns - The number of columns| Method Detail |
|---|
public void setHeader(int column,
CharSequence header)
column - The column to set the headerheader - The headerpublic CharSequence getHeader(int column)
column - The colund to get the header
public void setField(int row,
int column,
CharSequence field)
row - The row index of the datacolumn - The column index of the datafield - The data field
public CharSequence getField(int row,
int column)
row - The row indexcolumn - The column index
public StringBuilder format(StringBuilder b)
b - The StringBuilder to append to
public StringBuffer format(StringBuffer b)
b - The StringBuffer to append to
public Appendable format(Appendable a)
throws IOException
a - The Appendable to output the text
IOException - Problems writing to the Appendablepublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||