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.1 (Iterative Forward Search)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic
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 2.1 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- 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 Vector getLines()
size
public int size()
isEmpty
public boolean isEmpty()
getLine
public CSVFile.CSVLine getLine(int idx)
lines
public Enumeration lines()
addLine
public void addLine(CSVFile.CSVLine line)
addLine
public void addLine(String line)
filter
public Vector filter(CSVFile.CSVFilter filter)
addLine
public CSVFile.CSVLine addLine()
addLine
public CSVFile.CSVLine addLine(CSVFile.CSVField[] fields)
addLine
public CSVFile.CSVLine addLine(Collection fields)
setHeader
public CSVFile.CSVLine setHeader(CSVFile.CSVField[] fields)
setHeader
public CSVFile.CSVLine setHeader(Collection 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)