|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mwc.sqld.db.CSVFileReader
A class to encapsulate reading of CSV files.
Constructor Summary | |
CSVFileReader(java.lang.String fileName,
boolean firstLineIsNames)
Create a CSV file from a file name. |
Method Summary | |
void |
close()
Close the CSV file. |
java.util.Enumeration |
colNames()
|
java.lang.String |
getValue(int index)
Get a value from the current record. |
java.lang.String |
getValue(java.lang.String name)
Get a value from the current record. |
static void |
main(java.lang.String[] args)
Test main entry point. |
void |
open()
Open the CSV file for reading. |
boolean |
readLine()
Read the next record. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CSVFileReader(java.lang.String fileName, boolean firstLineIsNames)
fileName
- the file name.firstLineIsNames
- is the first line of
the CSV file the names
of the colums.Method Detail |
public java.util.Enumeration colNames()
public void open() throws java.io.IOException
public void close() throws java.io.IOException
public boolean readLine() throws java.io.IOException
public java.lang.String getValue(int index)
index
- the zero based index of the field.public java.lang.String getValue(java.lang.String name)
name
- the name of a field.public static void main(java.lang.String[] args) throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |