public class TabbedRecordReader extends java.lang.Object implements FormatReader<DataRecord>
| Constructor and Description |
|---|
TabbedRecordReader(java.lang.String source)
Constructor, specifying the file to load.
|
TabbedRecordReader(java.net.URL dataUrl)
Construct a TabbedRecordReader to read from the specified URL stream.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead()
Return whether this reader is in a state where it can attempt to read
data.
|
void |
close()
Close the current reader stream.
|
java.lang.String |
getFilters()
Get the filters for this reader.
|
int |
getMaxRecordsRead()
Get the maximum number of records read by each call to
readData(). |
java.util.List<DataRecord> |
getRecords()
Returns all records read in by the Reader.
|
java.lang.String |
getSource()
Get the source for this reader
|
boolean |
hasMoreData()
returns whether the reader has more data to read.
|
java.util.List<DataRecord> |
readData()
Read data from the input stream.
|
void |
setFilters(java.lang.String filters)
Set the filters for this reader
|
void |
setInputStream(java.io.InputStream inStream)
Sets the input stream.
|
void |
setMaxRecordsRead(int maxRecordsRead)
Set the maximum number of records read by each call to
readData(). |
void |
setSource(java.lang.String source)
Set the source for this reader.
|
public TabbedRecordReader(java.lang.String source)
throws java.io.FileNotFoundException
source - the filename of the tabbed Filejava.io.FileNotFoundException - if the file is not availablepublic TabbedRecordReader(java.net.URL dataUrl)
throws java.io.IOException
dataUrl - the URL for the data streamjava.io.IOException - if there is a problem reading the URLpublic boolean canRead()
canRead in interface FormatReader<DataRecord>public void close()
close in interface FormatReader<DataRecord>public java.lang.String getFilters()
getFilters in interface FormatReader<DataRecord>public int getMaxRecordsRead()
readData().public java.util.List<DataRecord> getRecords()
public java.lang.String getSource()
getSource in interface FormatReader<DataRecord>public boolean hasMoreData()
hasMoreData in interface FormatReader<DataRecord>public java.util.List<DataRecord> readData()
readData in interface FormatReader<DataRecord>public void setFilters(java.lang.String filters)
setFilters in interface FormatReader<DataRecord>filters - public void setInputStream(java.io.InputStream inStream)
inStream - the input streampublic void setMaxRecordsRead(int maxRecordsRead)
readData(). If this is not explicitly set, the maximum
records is set to -1, which signifies no limit.maxRecordsRead - the maximum records readpublic void setSource(java.lang.String source)
setSource in interface FormatReader<DataRecord>source - the source (file) for the reader