org.lenskit.util.table.writer

## Interface TableWriter

• ### Method Summary

All Methods
Modifier and Type Method and Description
void close()
Finish the table.
void flush()
Flush the writer, causing all currently-written rows to be flushed to output.
TableLayout getLayout()
Get the layout of this table.
void writeRow(List<?> row)
Write a row to the table.
void writeRow(Object... row)
Write a row to the table.
• ### Method Detail

• #### getLayout

TableLayout getLayout()

Get the layout of this table.

Returns:
The table’s layout.
• #### writeRow

void writeRow(Object... row)
throws IOException

Write a row to the table. This method is thread-safe.

Parameters:
row - A row of values. If the table requires more columns, the remaining columns are empty. The row is copied if necessary; the caller is free to re-use the same array for returnValue calls.
Throws:
IOException - if an error occurs writing the row.
IllegalArgumentException - if row has the incorrect number of columns.
• #### writeRow

void writeRow(List<?> row)
throws IOException

Write a row to the table. This method is thread-safe.

Parameters:
row - A row of values. If the table requires more columns, the remaining columns are empty. The row is copied if necessary; the caller is free to re-use the same array for returnValue calls.
Throws:
IOException - if an error occurs writing the row.
IllegalArgumentException - if row has the incorrect number of columns.
Since:
1.1
• #### flush

void flush()
throws IOException

Flush the writer, causing all currently-written rows to be flushed to output.

Throws:
IOException - if an error occurs while flushing output.
• #### close

void close()
throws IOException

Finish the table. Depending on how it was constructed, some underlying resource may be closed.

Specified by:
close in interface AutoCloseable
Specified by:
close in interface Closeable
Throws:
IOException