public class TextFileRowWriter extends AbstractTextFileHandler implements RowWriter
COMMA, TAB| Constructor and Description |
|---|
TextFileRowWriter(BufferedWriter bufferedWriter) |
TextFileRowWriter(Path path)
Constructs an initialised reader using a file.
|
TextFileRowWriter(String reference)
Constructs an initialised reader using a string reference to a text file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the data source, freeing up an resources.
|
protected String |
convertValue(Object value) |
void |
flush() |
protected void |
initialise()
Initialises the writer.
|
boolean |
newColumn()
Creates a new column in the data source
|
boolean |
newRow()
Creates a new row in the data source
|
void |
writeCell(Object cell)
Writes the value in the current cell of the data source
|
void |
writeCells(List<List<Object>> cells)
Write all cells to the data source in one step
|
void |
writeCellsAsArray(Object[][] cells)
Write all cells to the data source in one step
|
void |
writeRowCells(List<Object> cells)
Writes the row cells to the data source
|
void |
writeRowCellsAsArray(Object[] cells)
Writes the row cells to the data source
|
getColumnCount, getColumnIndex, getCommentString, getDelimiterString, getPath, getPathReference, getRowCount, getRowIndex, getRowPosition, getRowSize, incrementColumnIndex, incrementRowIndex, incrementRowPosition, isInStrictMode, isInUse, isRowSizesEqual, isRowSizeSetExternally, ready, resetCellIndex, setColumnIndex, setCommentString, setDelimiterString, setFileReference, setInStrictMode, setPath, setRowIndex, setRowPosition, setRowSize, setRowSizeInternal, updateRowFromSize, updateRowSizepublic TextFileRowWriter(String reference) throws IOException, FileNotFoundException
reference - a text file name or URLFileNotFoundException - if the file to write is not foundIOException - if an I/O error occurspublic TextFileRowWriter(Path path) throws IOException, FileNotFoundException
path - the Path to file to be written.FileNotFoundException - if the file to write is not foundIOException - if an I/O error occurspublic TextFileRowWriter(BufferedWriter bufferedWriter) throws IOException
IOExceptionpublic final void close()
Readerclose in interface AutoCloseableclose in interface Readerpublic final void flush()
public final void writeCellsAsArray(Object[][] cells) throws IOException
TableWriterwriteCellsAsArray in interface TableWritercells - the cells to be written to the data sourceIOException - if the data can not be writtenpublic final void writeCells(List<List<Object>> cells) throws IOException
TableWriterwriteCells in interface TableWritercells - the cells to be written to the data sourceIOException - if the data can not be writtenpublic final void writeRowCellsAsArray(Object[] cells) throws IOException
RowWriterwriteRowCellsAsArray in interface RowWritercells - row cells to be written to the data sourceIOException - if the data can not be writtenpublic final void writeRowCells(List<Object> cells) throws IOException
RowWriterwriteRowCells in interface RowWritercells - row cells to be written to the data sourceIOException - if the data can not be writtenpublic final void writeCell(Object cell) throws IOException
TableWriterwriteCell in interface TableWritercell - valueIOException - if the data can not be writtenpublic final boolean newRow()
throws IOException
TableWriternewRow in interface TableWritertrue if the row was created, false otherwiseIOException - if a new row can not be createdpublic final boolean newColumn()
throws IOException
TableWriternewColumn in interface TableWritertrue if the column was created, false otherwiseIOException - if a new column can not be createdprotected final void initialise()
throws FileNotFoundException,
IOException
initialise in class AbstractTextFileHandlerFileNotFoundException - if the file to write is not foundIOException - if an I/O error occursCopyright © 2016. All rights reserved.