Package com.nt.udc.io
Class CStringDataSink
java.lang.Object
com.nt.udc.io.CStringDataSink
- All Implemented Interfaces:
IDataSink
This class is used to write data into files in a specified output
directory.
- Since:
- JDK1.1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
This member represents the current record number.protected static int
protected FilenameGenerator
This member is used to generate filenames.protected String
This member represents the output file prefix.protected String
This member represents the output file suffix.protected ILogger
This member is used for reporting errors and warnings.protected int
This member represents the maximum records to be written to a file.protected File
This member represents the output filename.protected String
This member represents the directory files are eventually written to.protected String
This member represents the scratch directoryprotected FileWriter
This member represents the writer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
static int
int
protected String
This function is used to return a new filename unique to the current output directory.static void
setDebugLevel
(int debugLevel) final void
setFilenameGenerator
(FilenameGenerator filenameGen) void
setFilePrefix
(String filePrefix) void
setFileSuffix
(String fileSuffix) void
setMaxRecordsPerFile
(int maxRecordsPerFile) boolean
start()
This function is called to start writing.boolean
stop()
This function is called to stop writing.boolean
This function is called to write a string to the output medium.
-
Field Details
-
m_debugLevel
protected static int m_debugLevel -
m_iLogger
This member is used for reporting errors and warnings. -
m_scratchDir
This member represents the scratch directory -
m_outputDir
This member represents the directory files are eventually written to. -
m_outFile
This member represents the output filename. -
m_writer
This member represents the writer. -
m_filePrefix
This member represents the output file prefix. -
m_fileSuffix
This member represents the output file suffix. -
m_maxRecordsPerFile
protected int m_maxRecordsPerFileThis member represents the maximum records to be written to a file. -
m_currentRecNo
protected int m_currentRecNoThis member represents the current record number. -
m_filenameGen
This member is used to generate filenames.
-
-
Constructor Details
-
CStringDataSink
-
-
Method Details
-
getDebugLevel
public static int getDebugLevel() -
getScratchDir
-
getOutputDir
-
getFilePrefix
-
getFileSuffix
-
getMaxRecordsPerFile
public int getMaxRecordsPerFile() -
setDebugLevel
public static void setDebugLevel(int debugLevel) -
setFilePrefix
-
setFileSuffix
-
setMaxRecordsPerFile
public void setMaxRecordsPerFile(int maxRecordsPerFile) -
setFilenameGenerator
-
writeData
This function is called to write a string to the output medium. -
start
public boolean start()This function is called to start writing. -
stop
public boolean stop()This function is called to stop writing. -
getNewFilename
This function is used to return a new filename unique to the current output directory.- Returns:
- true if successful, false otherwise
-
error
-
debug
-