@ThreadSafe
public interface TableWriter
extends java.io.Closeable
Write rows to a table.
Instances of this class are used to actually write rows to a table. Once the table has finished, call close()
to finish the table and close the underlying output.
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(java.util.List<?> row)
Write a row to the table.
|
void |
writeRow(java.lang.Object... row)
Write a row to the table.
|
TableLayout getLayout()
Get the layout of this table.
void writeRow(java.lang.Object... row) throws java.io.IOException
Write a row to the table. This method is thread-safe.
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.java.io.IOException
- if an error occurs writing the row.java.lang.IllegalArgumentException
- if row
has the incorrect number of columns.void writeRow(java.util.List<?> row) throws java.io.IOException
Write a row to the table. This method is thread-safe.
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.java.io.IOException
- if an error occurs writing the row.java.lang.IllegalArgumentException
- if row
has the incorrect number of columns.void flush() throws java.io.IOException
Flush the writer, causing all currently-written rows to be flushed to output.
java.io.IOException
- if an error occurs while flushing output.void close() throws java.io.IOException
Finish the table. Depending on how it was constructed, some underlying resource may be closed.
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
java.io.IOException