|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jmatchparser.util.csv.AbstractCSVReader
public abstract class AbstractCSVReader
Abstract base class to read data from several CSV-like file formats.
| Constructor Summary | |
|---|---|
AbstractCSVReader()
|
|
| Method Summary | ||
|---|---|---|
abstract void |
close()
Close this reader. |
|
abstract String[] |
read()
Read a line from the CSV file. |
|
String[] |
read(int columnCount)
Read a line from the CSV file and pad it to the given number of columns with empty strings. |
|
|
read(T[] headers,
boolean includeEmptyColumns)
Read a line from the CSV file, and pass its columns into a Map
using the given keys/headers. |
|
void |
writeTo(AbstractCSVWriter writer)
Write the complete content of this reader to the given AbstractCSVWriter and close both reader and writer. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractCSVReader()
| Method Detail |
|---|
public final <T> Map<T,String> read(T[] headers,
boolean includeEmptyColumns)
throws IOException
Map
using the given keys/headers.
T - Type of the keysheaders - Keys/HeadersincludeEmptyColumns - Whether to include empty column values in the map
IOException
public final String[] read(int columnCount)
throws IOException
columnCount - Desired number of columns
IOException - if there are too many columns in the original line.
public void writeTo(AbstractCSVWriter writer)
throws IOException
AbstractCSVWriter and close both reader and writer.
writer - The writer to write to
IOException
public abstract String[] read()
throws IOException
IOException
public abstract void close()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||