net.sourceforge.addam.impexp.csv
Class CSVParser

java.lang.Object
  extended by net.sourceforge.addam.impexp.csv.CSVParser
Direct Known Subclasses:
MapCSVParser

public class CSVParser
extends Object

Reads CSV files according to the rules outlined on Creativyst

Since:
Jul 30, 2004
Author:
TIM3

Field Summary
private  int charNumber
           
private  int col
           
private  BufferedReader in
           
private  StringCharacterIterator lineIterator
           
private  int lineNumber
           
private  int row
           
 
Constructor Summary
CSVParser(Reader in)
          creates a CSV reader according to the rules in http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
 
Method Summary
 int getCharNumber()
           
 int getCol()
           
 String getExcelCell()
           
(package private)  String getExcelCell(int row, int col)
           
 int getLineNumber()
           
 int getRow()
           
protected  boolean nextLine()
           
protected  String readField()
          reads a string array from a record, which may appear on one or more lines
 List readLine()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

private final BufferedReader in

lineIterator

private StringCharacterIterator lineIterator

lineNumber

private int lineNumber

charNumber

private int charNumber

row

private int row

col

private int col
Constructor Detail

CSVParser

public CSVParser(Reader in)
creates a CSV reader according to the rules in http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm

Parameters:
in -
Method Detail

readLine

public List readLine()
              throws IOException,
                     CSVFormatException
Throws:
IOException
CSVFormatException

nextLine

protected boolean nextLine()
                    throws IOException
Throws:
IOException

readField

protected String readField()
                    throws IOException,
                           CSVFormatException
reads a string array from a record, which may appear on one or more lines

Returns:
Throws:
IOException
CSVFormatException

getLineNumber

public int getLineNumber()

getCharNumber

public int getCharNumber()

getRow

public int getRow()

getCol

public int getCol()

getExcelCell

public String getExcelCell()
Returns:
the column as an Excel string, i.e. 1=A, 2=B, 27=AA, 28=AB, etc.

getExcelCell

String getExcelCell(int row,
                    int col)


Copyright © 2005-2006 ADDAM Project Team. All Rights Reserved.