public class CSVFile extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
CSVFile.CSVField
Representation of a field of a CSV file
|
static interface |
CSVFile.CSVFilter
An interface for filtering lines of a CSV file
|
class |
CSVFile.CSVLine
Representation of a line of a CSV file
|
Constructor and Description |
---|
CSVFile() |
CSVFile(File file) |
CSVFile(File file,
String separator) |
CSVFile(File file,
String separator,
String quotationMark) |
public CSVFile()
public CSVFile(File file) throws IOException
IOException
public CSVFile(File file, String separator) throws IOException
IOException
public CSVFile(File file, String separator, String quotationMark) throws IOException
IOException
public void setSeparator(String separator)
public String getSeparator()
public void setQuotationMark(String quotationMark)
public String getQuotationMark()
public void load(File file) throws IOException
IOException
public void save(File file) throws IOException
IOException
public CSVFile.CSVLine getHeader()
public void setHeader(CSVFile.CSVLine header)
public List<CSVFile.CSVLine> getLines()
public int size()
public boolean isEmpty()
public CSVFile.CSVLine getLine(int idx)
public Iterator<CSVFile.CSVLine> lines()
public void addLine(CSVFile.CSVLine line)
public List<CSVFile.CSVLine> filter(CSVFile.CSVFilter filter)
public CSVFile.CSVLine addLine()
public CSVFile.CSVLine addLine(CSVFile.CSVField[] fields)
public CSVFile.CSVLine addLine(Collection<CSVFile.CSVField> fields)
public CSVFile.CSVLine setHeader(CSVFile.CSVField[] fields)
public CSVFile.CSVLine setHeader(Collection<CSVFile.CSVField> fields)
public static CSVFile.CSVFilter eq(String name, String value)
public static CSVFile.CSVFilter and(CSVFile.CSVFilter first, CSVFile.CSVFilter second)
public static CSVFile.CSVFilter or(CSVFile.CSVFilter first, CSVFile.CSVFilter second)
public static CSVFile.CSVFilter not(CSVFile.CSVFilter filter)