deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.commons.dataaccess
Class CSVReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by java.io.LineNumberReader
              extended by org.deegree.commons.dataaccess.CSVReader
All Implemented Interfaces:
Closeable, Readable

public class CSVReader
extends LineNumberReader

The CSVReader reads a csv file line by line. Note the regular expression for quotes may not work under all circumstances, a Tokenizer might be a better solution.

Version:
$Revision: 18171 $, $Date: 2009-06-17 16:00:07 +0200 (Mi, 17 Jun 2009) $
Author:
Rutger Bezema, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
CSVReader(Reader in, String delimiter, boolean firstLineContainsColumnNames)
           
 
Method Summary
 String[] getColumnsNames()
           
 String getDelimiter()
           
 int getNumberOfColumns()
           
 String[] parseLine()
           
 
Methods inherited from class java.io.LineNumberReader
getLineNumber, mark, read, read, readLine, reset, setLineNumber, skip
 
Methods inherited from class java.io.BufferedReader
close, markSupported, ready
 
Methods inherited from class java.io.Reader
read, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVReader

public CSVReader(Reader in,
                 String delimiter,
                 boolean firstLineContainsColumnNames)
Parameters:
in -
delimiter -
firstLineContainsColumnNames -
Method Detail

parseLine

public String[] parseLine()
                   throws IOException
Returns:
the values of the
Throws:
IOException

getColumnsNames

public final String[] getColumnsNames()
Returns:
the values of the first row, which may be the column names or the first line of data.

getNumberOfColumns

public final int getNumberOfColumns()
Returns:
the numberOfColumns

getDelimiter

public final String getDelimiter()
Returns:
the delimiter

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>