public class CsvFile extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CsvFile.Line
A line in a CSV-file.
|
static interface |
CsvFile.LineFilter |
| Modifier and Type | Field and Description |
|---|---|
static String |
BLOCK_INDICATOR
Indicates start of block inside a CSV file.
|
| Constructor and Description |
|---|
CsvFile(File csvFile)
Constructor.
|
CsvFile(File csvFile,
CsvFile.LineFilter filter)
Constructor.
|
CsvFile(File csvFile,
String block)
Constructor.
|
CsvFile(File csvFile,
String block,
CsvFile.LineFilter filter)
Constructor.
|
CsvFile(InputStream in,
String block,
String location,
CsvFile.LineFilter filter)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String[] line)
Checks if a certain line can be found in this file.
|
static String[] |
decodeLine(String line)
Decodes and splits csv-line.
|
static String |
encodeCell(String cell)
Encodes and csv-cell.
|
List<CsvFile.Line> |
getLines()
Gets the list of lines.
|
public static String BLOCK_INDICATOR
public CsvFile(File csvFile) throws IOException
csvFile - the csv fileIOExceptionpublic CsvFile(File csvFile, CsvFile.LineFilter filter) throws IOException
csvFile - the csv fileIOExceptionpublic CsvFile(File csvFile, String block) throws IOException
csvFile - the csv fileblock - the block to read, null to read default blockIOExceptionpublic CsvFile(File csvFile, String block, CsvFile.LineFilter filter) throws IOException
csvFile - the csv fileblock - the block to read, null to read default blockIOExceptionpublic CsvFile(InputStream in, String block, String location, CsvFile.LineFilter filter) throws IOException
in - to read fromblock - the block to read, null to read default blockIOExceptionpublic static String[] decodeLine(String line)
line - the line to decodepublic static String encodeCell(String cell)
cell - the cell to encodepublic List<CsvFile.Line> getLines()
public boolean contains(String[] line)
the - linetrue iff this file contains the line