public abstract class AbstractTextFileHandler extends Object implements TextFileHandler
COMMA, TAB| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTextFileHandler() |
|
AbstractTextFileHandler(Path path)
Constructs an initialised reader using a file.
|
|
AbstractTextFileHandler(String reference)
Constructs an initialised reader using a string reference to a text file.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getColumnCount() |
protected int |
getColumnIndex() |
String |
getCommentString()
Gets the string which indicates at comment line that should be ignored by
the reader.
|
String |
getDelimiterString()
Gets the string which indicates a new field in a record.
|
Path |
getPath()
Gets the file associated with this handler
|
String |
getPathReference() |
int |
getRowCount() |
protected int |
getRowIndex() |
protected int |
getRowPosition() |
int |
getRowSize() |
protected void |
incrementColumnIndex() |
protected void |
incrementRowIndex() |
protected void |
incrementRowPosition() |
protected void |
initialise()
Initialises the reader.
|
boolean |
isInStrictMode() |
protected boolean |
isInUse() |
protected boolean |
isRowSizesEqual() |
protected boolean |
isRowSizeSetExternally() |
boolean |
ready() |
protected void |
resetCellIndex() |
protected void |
setColumnIndex(int columnIndex) |
void |
setCommentString(String comment)
Sets the string which indicates a comment line that should be ignored by
the reader.
|
void |
setDelimiterString(String delimiter)
Sets the string which indicates a new field in a record.
|
void |
setFileReference(String pathReference) |
void |
setInStrictMode(boolean isInStrictMode) |
void |
setPath(Path path) |
protected void |
setRowIndex(int rowIndex) |
protected void |
setRowPosition(int rowPosition) |
void |
setRowSize(int rowSize) |
protected void |
setRowSizeInternal(int rowSize) |
protected void |
updateRowFromSize(List<Object> row)
Add addition cells to row to ensure it is the same size as other rows
|
protected void |
updateRowSize(int size) |
protected AbstractTextFileHandler()
public AbstractTextFileHandler(String reference) throws IOException, FileNotFoundException
reference - a text file name or URLFileNotFoundException - if the file to read/write is not foundIOException - if an I/O error occurspublic AbstractTextFileHandler(Path path) throws IOException, FileNotFoundException
path - a Path object.FileNotFoundException - if the file to read/write is not foundIOException - if an I/O error occurspublic boolean ready()
truepublic final int getRowCount()
public final int getColumnCount()
public final String getCommentString()
public final String getPathReference()
public final void setFileReference(String pathReference) throws IOException
IOExceptionpublic final Path getPath()
TextFileHandlergetPath in interface TextFileHandlerpublic final void setPath(Path path) throws IOException
IOExceptionpublic final boolean isInStrictMode()
public final void setInStrictMode(boolean isInStrictMode)
throws IOException
IOExceptionpublic final void setCommentString(String comment) throws IOException
null if no comments are allowedcomment - the comment stringIOException - if the reader/writer is in usepublic final String getDelimiterString()
public void setDelimiterString(String delimiter) throws IOException
delimiter - the delimiter stringIOException - if the reader is currently in useprotected void initialise()
throws FileNotFoundException,
IOException
FileNotFoundException - if the file to read/write is not foundIOException - if an I/O error occursprotected final void updateRowFromSize(List<Object> row) throws IOException
row - row to completeIOException - if the row can not be completedpublic final int getRowSize()
public final void setRowSize(int rowSize)
throws IOException
IOExceptionprotected final void setRowSizeInternal(int rowSize)
protected final void updateRowSize(int size)
throws IOException
IOExceptionprotected final boolean isRowSizesEqual()
protected final int getRowIndex()
protected final void setRowIndex(int rowIndex)
protected final void incrementRowIndex()
protected final int getRowPosition()
protected final void setRowPosition(int rowPosition)
protected final void incrementRowPosition()
protected final boolean isInUse()
protected final int getColumnIndex()
protected final void setColumnIndex(int columnIndex)
protected final void incrementColumnIndex()
protected final void resetCellIndex()
protected final boolean isRowSizeSetExternally()
Copyright © 2016. All rights reserved.