|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjhplot.io.csv.CSVReader
public class CSVReader
A very simple CSV reader released under a commercial-friendly license.
| Field Summary | |
|---|---|
static char |
DEFAULT_QUOTE_CHARACTER
The default quote character to use if none is supplied to the constructor. |
static char |
DEFAULT_SEPARATOR
The default separator to use if none is supplied to the constructor. |
static int |
DEFAULT_SKIP_LINES
The default line to start reading. |
| Constructor Summary | |
|---|---|
CSVReader(Reader reader)
Constructs CSVReader using a comma for the separator. |
|
CSVReader(Reader reader,
char separator)
Constructs CSVReader with supplied separator. |
|
CSVReader(Reader reader,
char separator,
char quotechar)
Constructs CSVReader with supplied separator and quote char. |
|
CSVReader(Reader reader,
char separator,
char quotechar,
int line)
Constructs CSVReader with supplied separator and quote char. |
|
CSVReader(String file)
Constructs CSVReader using a comma for the separator. |
|
CSVReader(String file,
char separator)
Constructs CSVReader with supplied separator. |
|
CSVReader(String file,
char separator,
char quotechar)
Constructs CSVReader with supplied separator and quote char. |
|
CSVReader(String file,
char separator,
char quotechar,
int line)
Constructs CSVReader with supplied separator and quote char. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the underlying reader. |
void |
doc()
Show online documentation. |
ArrayList<String> |
next()
Reads the next line from the buffer and converts to a string List. |
ArrayList<String[]> |
readAll()
Reads the entire file into a List with each element being a String[] of tokens. |
ArrayList<ArrayList> |
readList()
Reads the entire file into a List with each element being a List of tokens. |
String[] |
readNext()
Reads the next line from the buffer and converts to a string array. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char DEFAULT_SEPARATOR
public static final char DEFAULT_QUOTE_CHARACTER
public static final int DEFAULT_SKIP_LINES
| Constructor Detail |
|---|
public CSVReader(Reader reader)
reader - the reader to an underlying CSV source.public CSVReader(String file)
file - file with an underlying CSV source.
public CSVReader(Reader reader,
char separator)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entries.
public CSVReader(String file,
char separator)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entries.
public CSVReader(Reader reader,
char separator,
char quotechar)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elements
public CSVReader(String file,
char separator,
char quotechar)
file - file with an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elements
public CSVReader(Reader reader,
char separator,
char quotechar,
int line)
reader - the reader to an underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsline - the line number to skip for start reading
public CSVReader(String file,
char separator,
char quotechar,
int line)
file - file with underlying CSV source.separator - the delimiter to use for separating entriesquotechar - the character to use for quoted elementsline - the line number to skip for start reading| Method Detail |
|---|
public void doc()
public ArrayList<String[]> readAll()
throws IOException
IOException - if bad things happen during the read
public ArrayList<ArrayList> readList()
throws IOException
IOException - if bad things happen during the read
public String[] readNext()
throws IOException
IOException - if bad things happen during the read
public ArrayList<String> next()
throws IOException
IOException - if bad things happen during the read
public void close()
throws IOException
IOException - if the close fails
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||