public class NetricsCSVReader extends java.lang.Object implements NetricsFieldedReader
Constructor and Description |
---|
NetricsCSVReader(java.io.BufferedReader in_stream)
Create a CSV Reader from an already opened stream.
|
NetricsCSVReader(java.lang.String file_name,
java.lang.String char_set_name)
Create a reader for a Named CSV file.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes files opened by this object.
|
java.lang.String |
curLine()
Return the text of the last line processed.
|
int |
curLineNum()
Return the line number (1 based) of the next line to read.
|
java.lang.String[] |
readRecord()
Read a single logical CSV record.
|
void |
reset()
Reset the read back to the first record.
|
public NetricsCSVReader(java.lang.String file_name, java.lang.String char_set_name) throws java.io.FileNotFoundException, NetricsFileFormatException
file_name
- The name of a file to be read as a CSV file.char_set_name
- The name of the character encoding for the file.
If null the default character set of latin-1
(ISO-8859-1) is used.java.io.FileNotFoundException
NetricsFileFormatException
public NetricsCSVReader(java.io.BufferedReader in_stream)
in_stream
- The input stream the CSV data is read from.public int curLineNum()
curLineNum
in interface NetricsFieldedReader
public java.lang.String curLine()
public void reset() throws NetricsFileFormatException
reset
in interface NetricsFieldedReader
NetricsFileFormatException
public void close() throws NetricsFileFormatException
close
in interface NetricsFieldedReader
NetricsFileFormatException
public java.lang.String[] readRecord() throws NetricsFileFormatException
readRecord
in interface NetricsFieldedReader
NetricsFileFormatException