public class HTMLTableFormatter extends AbstractTableFormatter
Constructor and Description |
---|
HTMLTableFormatter() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the HTML file by writing the footing tags, flushing the buffer and
closing the file.
|
void |
closeRow()
Writes the tag to close a row in a table to the file.
|
void |
closeTable()
Inserts the tags needed to close a HTML 3.2 table into the file.
|
void |
closeTableNoTopTag()
Inserts the tags needed to close a HTML 3.2 table into the file.
|
java.lang.String |
getFileFormat() |
void |
open(java.lang.String name)
Opens a new file with the given fileName for writing a HTML table to.
|
void |
openRow()
Writes the HTML 3.2 tags to open a new row in a table to the file.
|
void |
openTable(java.lang.String s)
Inserts the tags needed to build a HTML 3.2 table heading into the file.
|
boolean |
rowIsOpen()
Returns the status of the current table row that is written to.
|
boolean |
tableIsOpen()
Returns the status of the current table that is written to.
|
void |
writeCell(java.lang.String s,
int spanning)
Creates a new table cell and writes the given String into that cell.
|
void |
writeHeading(int style,
java.lang.String s)
Creates a newcentered heading row to print a title in.
|
void |
writeHeadingCell(java.lang.String s)
Creates a new table cell and writes the given String into that cell as
heading cells in bold letters and with centered text.
|
void |
writeHorizontalRuler()
Writes the HTML tag for inserting a horizontal ruler into the file.
|
openRow, setOutput, setTimePrecision, timePrecision, writeTime
public void close()
public void closeRow()
public void closeTable()
public void closeTableNoTopTag()
closeTable()
. This is needed if
one reportable is generating a report that consists of more than one
table (see StockReporter
or HistogramReporter
)public void open(java.lang.String name)
name
- java.lang.String : The name of the file to be createdpublic void openRow()
public void openTable(java.lang.String s)
s
- String : The heading for the tablepublic boolean rowIsOpen()
rowIsOpen
in interface TableFormatter
rowIsOpen
in class AbstractTableFormatter
true
if the method
openRow()
has been called last, false
if the method closeRow()
has been called lastTableFormatter.rowIsOpen()
public boolean tableIsOpen()
tableIsOpen
in interface TableFormatter
tableIsOpen
in class AbstractTableFormatter
true
if the method
openTable()
has been called last,
false
if the method closeTable()
has been called lastTableFormatter.tableIsOpen()
public void writeCell(java.lang.String s, int spanning)
s
- java.lang.String : The text to be printed into a cellspanning
- number of cells to spanpublic void writeHeading(int style, java.lang.String s)
style
- int : The heading style format number for the text to be
printed ins
- java.lang.String : The text to be printed as headingpublic void writeHeadingCell(java.lang.String s)
s
- java.lang.String : The text to be printed into a cellpublic void writeHorizontalRuler()
public java.lang.String getFileFormat()
"html"