jimm.datavision.source.charsep
Class DelimParser
java.lang.Object
jimm.datavision.source.charsep.DelimParser
public class DelimParser
- extends java.lang.Object
Parses delimited data. Handles quotes and embedded delimiters.
- Author:
- Jim Menard, jimm@io.com
|
Constructor Summary |
DelimParser(java.io.Reader in)
Constructor, using ',' as the delimiter. |
DelimParser(java.io.Reader in,
char delimiter)
Constructor. |
|
Method Summary |
protected int |
nextChar()
|
java.util.List |
parse()
Returns an array of column data or null if there is no more
data. |
protected void |
pushback(int charAsInt)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EOF
public static final int EOF
- See Also:
- Constant Field Values
delimiter
protected char delimiter
in
protected java.io.Reader in
pushbackChar
protected int pushbackChar
DelimParser
public DelimParser(java.io.Reader in)
- Constructor, using ',' as the delimiter. The caller must close
in.
- Parameters:
in - input reader
DelimParser
public DelimParser(java.io.Reader in,
char delimiter)
- Constructor. The caller must close in.
- Parameters:
in - input readerdelimiter - delimiter character
parse
public java.util.List parse()
throws java.io.IOException
- Returns an array of column data or
null if there is no more
data. Handles delimiters and quotes within the data just as they are
generated by Excel comma- and tab-separated files.
- Returns:
- a
List of strings; return null if
there is no more data.
- Throws:
java.io.IOException
nextChar
protected int nextChar()
throws java.io.IOException
- Throws:
java.io.IOException
pushback
protected void pushback(int charAsInt)