Package com.nt.udc.io
Interface IDataSource
- All Known Implementing Classes:
CDataSourceFileMgr
,CDataSourceSingleFile
,CDataSourceSuperTail
public interface IDataSource
This interface is to be implemented by character stream data sources.
- Since:
- JDK1.1.7
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
end()
This function is called to end reading.boolean
boolean
This function is called to initialize the data source.boolean
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.boolean
start()
This function is called to start reading.boolean
This function is called to terminate the data source.
-
Field Details
-
EOF
static final char EOF- See Also:
-
-
Method Details
-
getSourceName
String getSourceName()- Returns:
- The name of the source.
-
hasMoreData
boolean hasMoreData()- Returns:
- true if more input is available.
-
nextChar
- Returns:
- The next character from the input. If no more characters are available, IDataSource.EOF is returned instead.
- Throws:
Exception
-
read
This function reads a given number of characters from the source.- Returns:
- The number of characters actually read.
- Throws:
Exception
-
initialize
boolean initialize()This function is called to initialize the data source. -
terminate
boolean terminate()This function is called to terminate the data source. -
start
boolean start()This function is called to start reading. Classes implementing IDataSource may use it for initialization.- Returns:
- true if successful, false otherwise
-
end
boolean end()This function is called to end reading. Classes implementing IDataSource may use it for clean-up operations.- Returns:
- true if successful, false otherwise
-
setBookmark
boolean setBookmark(int lineNo) This function is called to mark a certain position in the input stream. This mark may be stored on a persistent medium in order to avoid re-reading the same data during the next reading session. -
isHealthy
boolean isHealthy()- Returns:
- true if the data source is OK, false otherwise.
-