Package com.nt.udc.io

Class CDataSink

java.lang.Object
com.nt.udc.io.CDataSink
All Implemented Interfaces:
IDataSink

public class CDataSink extends Object implements IDataSink
This class is used to write data into files in a specified output directory.
Since:
JDK1.1.7
  • Field Details

    • m_iLogger

      protected ILogger m_iLogger
      This member is used for reporting errors and warnings.
    • m_outputDir

      protected String m_outputDir
      This member is the directory files are written to.
    • m_outputStream

      protected DataOutputStream m_outputStream
      This member is the stream we output data to.
    • m_filePrefix

      protected String m_filePrefix
      This member is the output file prefix.
    • m_fileSuffix

      protected String m_fileSuffix
      This member is the output file suffix.
    • m_filenameGen

      protected FilenameGenerator m_filenameGen
      This member is used to generate filenames
  • Constructor Details

    • CDataSink

      public CDataSink(String outputDir, ILogger iLogger)
  • Method Details

    • getOutputDir

      public String getOutputDir()
    • getFilePrefix

      public String getFilePrefix()
    • getFileSuffix

      public String getFileSuffix()
    • setFilePrefix

      public void setFilePrefix(String filePrefix)
    • setFileSuffix

      public void setFileSuffix(String fileSuffix)
    • setFilenameGenerator

      public final void setFilenameGenerator(FilenameGenerator filenameGen)
    • writeData

      public boolean writeData(Object data)
      This function is called to write a string to the output medium.
      Specified by:
      writeData in interface IDataSink
      Returns:
      true if successful, false otherwise
    • start

      public boolean start()
      This function is called to start writing.
      Specified by:
      start in interface IDataSink
      Returns:
      true if successful, false otherwise
    • stop

      public boolean stop()
      This function is called to stop writing.
      Specified by:
      stop in interface IDataSink
      Returns:
      true if successful, false otherwise
    • getNewFilename

      protected String getNewFilename()
      This function is used to return a new filename unique to the current output directory.
      Returns:
      true if successful, false otherwise