public class CDataSourceSingleFile extends java.lang.Object implements IDataSource
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
m_filename
This member represents the input filename
|
protected java.io.FileInputStream |
m_inputStream
This member represents the input stream to read from.
|
protected java.io.BufferedReader |
m_reader
This member is actually used for reading data.
|
protected COSARReporter |
m_reporter
This member is used for reporting.
|
EOF| Constructor and Description |
|---|
CDataSourceSingleFile(java.lang.String filename) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
end()
This function is called to end reading.
|
protected void |
error(java.lang.String fName,
java.lang.String msg) |
COSARReporter |
getReporter() |
java.lang.String |
getSourceName() |
boolean |
hasMoreData() |
boolean |
initialize()
This function is called to initialize the data source.
|
boolean |
isHealthy() |
char |
nextChar() |
int |
read(char[] buf,
int len)
This function reads a given number of characters from the source.
|
boolean |
setBookmark(int lineNo)
This function is called to mark a certain position in the input
stream.
|
void |
setReporter(COSARReporter reporter) |
boolean |
start()
This function is called to start reading.
|
boolean |
terminate()
This function is called to terminate the data source.
|
protected java.lang.String m_filename
protected java.io.FileInputStream m_inputStream
protected java.io.BufferedReader m_reader
protected COSARReporter m_reporter
public CDataSourceSingleFile(java.lang.String filename)
throws java.lang.Exception
java.lang.Exceptionpublic COSARReporter getReporter()
public void setReporter(COSARReporter reporter)
public java.lang.String getSourceName()
getSourceName in interface IDataSourcepublic boolean hasMoreData()
hasMoreData in interface IDataSourcepublic char nextChar()
throws java.lang.Exception
nextChar in interface IDataSourcejava.lang.Exceptionpublic int read(char[] buf,
int len)
throws java.lang.Exception
IDataSourceread in interface IDataSourcejava.lang.Exceptionpublic boolean initialize()
IDataSourceinitialize in interface IDataSourcepublic boolean terminate()
IDataSourceterminate in interface IDataSourcepublic boolean start()
IDataSourcestart in interface IDataSourcepublic boolean end()
IDataSourceend in interface IDataSourcepublic boolean setBookmark(int lineNo)
IDataSourcesetBookmark in interface IDataSourcepublic boolean isHealthy()
isHealthy in interface IDataSourceprotected void error(java.lang.String fName,
java.lang.String msg)