net.sf.cpsolver.ifs.util
Class CSVFile
java.lang.Object
net.sf.cpsolver.ifs.util.CSVFile
- All Implemented Interfaces:
- Serializable
public class CSVFile
- extends Object
- implements Serializable
Support for CSV (comma separated) text files.
- Version:
- IFS 1.2 (Iterative Forward Search)
Copyright (C) 2006 - 2010 Tomas Muller
muller@unitime.org
http://muller.unitime.org
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 3 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not see
http://www.gnu.org/licenses/.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVFile
public CSVFile()
CSVFile
public CSVFile(File file)
throws IOException
- Throws:
IOException
CSVFile
public CSVFile(File file,
String separator)
throws IOException
- Throws:
IOException
CSVFile
public CSVFile(File file,
String separator,
String quotationMark)
throws IOException
- Throws:
IOException
setSeparator
public void setSeparator(String separator)
getSeparator
public String getSeparator()
setQuotationMark
public void setQuotationMark(String quotationMark)
getQuotationMark
public String getQuotationMark()
load
public void load(File file)
throws IOException
- Throws:
IOException
save
public void save(File file)
throws IOException
- Throws:
IOException
getHeader
public CSVFile.CSVLine getHeader()
setHeader
public void setHeader(CSVFile.CSVLine header)
getLines
public List<CSVFile.CSVLine> getLines()
size
public int size()
isEmpty
public boolean isEmpty()
getLine
public CSVFile.CSVLine getLine(int idx)
lines
public Iterator<CSVFile.CSVLine> lines()
addLine
public void addLine(CSVFile.CSVLine line)
addLine
public void addLine(String line)
filter
public List<CSVFile.CSVLine> filter(CSVFile.CSVFilter filter)
addLine
public CSVFile.CSVLine addLine()
addLine
public CSVFile.CSVLine addLine(CSVFile.CSVField[] fields)
addLine
public CSVFile.CSVLine addLine(Collection<CSVFile.CSVField> fields)
setHeader
public CSVFile.CSVLine setHeader(CSVFile.CSVField[] fields)
setHeader
public CSVFile.CSVLine setHeader(Collection<CSVFile.CSVField> fields)
eq
public static CSVFile.CSVFilter eq(String name,
String value)
and
public static CSVFile.CSVFilter and(CSVFile.CSVFilter first,
CSVFile.CSVFilter second)
or
public static CSVFile.CSVFilter or(CSVFile.CSVFilter first,
CSVFile.CSVFilter second)
not
public static CSVFile.CSVFilter not(CSVFile.CSVFilter filter)
Copyright © 2014 UniTime LLC. All Rights Reserved.