Package csv
Interface TableWriter
- All Known Implementing Classes:
AbstractStreamTableWriter,AbstractTableWriter,CSVWriter,ExcelWriter,HtmlWriter,XExcelWriter,XmlWriter
public interface TableWriter
Introduces an interface for other implementations
of table writing interfaces.
- Author:
- RalphSchuster
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the writer.voidprintComment(String comment) Prints a comment into the stream.voidprintComment(String comment, int row, int column) Prints a comment into the stream.voidPrints the columns into the table writer.voidprintRow(Collection<?> columns) Prints a single row into the CSV stream.voidPrints a new row into the CSV stream.voidPrints a single row into the CSV stream.
-
Method Details
-
printRow
Prints the columns into the table writer.- Parameters:
columns- columns to be written in row- Throws:
IOException- when an exception occurs
-
printRow
Prints a single row into the CSV stream. The columns are written to the CSV stream as the are delivered by the collection's iterator.- Parameters:
columns- collection of column values. An iterator will be used to retrieve values from the collection.- Throws:
IOException- when an exception occurs
-
printRow
Prints a single row into the CSV stream. The columns are written to the CSV stream as delivered by the iterator.- Parameters:
columns- iterator that returns column values.size- number of values to retrieve from iterator. Method will abort at this size.- Throws:
IOException- when an exception occurs
-
printRow
Prints a new row into the CSV stream. The columns are written to the CSV stream as delivered by the iterator.- Parameters:
columns- iterator that returns column values.- Throws:
IOException- when an exception occurs
-
printComment
Prints a comment into the stream. Note that not all implementations support comments.- Parameters:
comment- comment to write- Throws:
IOException- when an exception occurs
-
printComment
Prints a comment into the stream. Note that not all implementations support comments.- Parameters:
comment- comment to writerow- index of row for commentcolumn- index of column for comment- Throws:
IOException- when an exception occurs
-
close
void close()Closes the writer.
-