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
    Modifier and Type
    Field
    Description
    static final char
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    end()
    This function is called to end reading.
     
    boolean
     
    boolean
    This function is called to initialize the data source.
    boolean
     
    char
     
    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
    This function is called to start reading.
    boolean
    This function is called to terminate the data source.
  • Field Details

  • Method Details

    • getSourceName

      String getSourceName()
      Returns:
      The name of the source.
    • hasMoreData

      boolean hasMoreData()
      Returns:
      true if more input is available.
    • nextChar

      char nextChar() throws Exception
      Returns:
      The next character from the input. If no more characters are available, IDataSource.EOF is returned instead.
      Throws:
      Exception
    • read

      int read(char[] buf, int len) throws Exception
      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.