toxTree.io.batch
Class ChemObjectBatchProcessing

java.lang.Object
  extended by java.util.Observable
      extended by toxTree.io.batch.BatchProcessing
          extended by toxTree.io.batch.ChemObjectBatchProcessing
All Implemented Interfaces:
java.io.Serializable, IBatchProcessing
Direct Known Subclasses:
ToxTreeBatchProcessing

public class ChemObjectBatchProcessing
extends BatchProcessing

Implements batch processing of chemical files

Author:
Nina Jeliazkova Modified 2005-9-4
See Also:
Serialized Form

Field Summary
protected  org.openscience.cdk.interfaces.IChemObject chemObject
           
protected static int CSV_INDEX
           
static java.lang.String[] extensions
           
static java.lang.String[] extensions_descr
           
protected  org.openscience.cdk.io.iterator.IIteratingChemObjectReader reader
           
protected static int SDF_INDEX
           
protected static int SMI_INDEX
           
protected static int TXT_INDEX
           
protected  org.openscience.cdk.io.IChemObjectWriter writer
           
 
Fields inherited from class toxTree.io.batch.BatchProcessing
configFile, dateCreated, dateLastSaved, deleteConfigOnSuccess, inputFile, logger, MSG_CANTCREATEFILE, MSG_ERRORCOUNTING, MSG_ERRORSAVE, MSG_FILEDONOTEXISTS, MSG_OPEN, MSG_UNSUPPORTEDFORMAT, outputFile, saveStateFrequency, status, STATUS_ABORTED, STATUS_FINISHED, STATUS_NOTINITIALIZED, STATUS_NOTSTARTED, STATUS_PAUSED, STATUS_RUNNING, statusMsg, tmpDir
 
Constructor Summary
ChemObjectBatchProcessing()
           
ChemObjectBatchProcessing(java.io.File input, java.io.File output)
           
ChemObjectBatchProcessing(java.lang.String input, java.lang.String output)
           
 
Method Summary
 void closeInputFile()
           
 void closeOutputFile()
           
 void createOutputFile()
          Creates ChemObjectWriter
protected  org.openscience.cdk.io.iterator.IIteratingChemObjectReader getReader(FileState file, boolean monitor)
           
 boolean hasNextRecord()
           
 void openInputFile()
          Opens the input file as set by constructor and creates IteratingChemObjectReader
 void processRecord()
           
 void readRecord()
           
 void start()
           
 void writeRecord()
           
 
Methods inherited from class toxTree.io.batch.BatchProcessing
cancel, close, createConfigFile, equals, getConfigFile, getDateCreated, getDateLastProcessed, getInputFile, getOutputFile, getReadRecordsCount, getSaveStateFrequency, getStatus, getTempDir, getWrittenRecordsCount, isCancelled, isPaused, isRunning, isStatus, loadConfig, pause, saveConfig, saveConfig, setConfigFile, setSaveStateFrequency, setStatus, toString
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

reader

protected transient org.openscience.cdk.io.iterator.IIteratingChemObjectReader reader

writer

protected transient org.openscience.cdk.io.IChemObjectWriter writer

chemObject

protected transient org.openscience.cdk.interfaces.IChemObject chemObject

extensions

public static final transient java.lang.String[] extensions

extensions_descr

public static final transient java.lang.String[] extensions_descr

SDF_INDEX

protected static transient int SDF_INDEX

CSV_INDEX

protected static transient int CSV_INDEX

SMI_INDEX

protected static transient int SMI_INDEX

TXT_INDEX

protected static transient int TXT_INDEX
Constructor Detail

ChemObjectBatchProcessing

public ChemObjectBatchProcessing()

ChemObjectBatchProcessing

public ChemObjectBatchProcessing(java.lang.String input,
                                 java.lang.String output)
                          throws BatchProcessingException
Parameters:
input - Input file name
output - Output file name
Throws:
BatchProcessingException

ChemObjectBatchProcessing

public ChemObjectBatchProcessing(java.io.File input,
                                 java.io.File output)
                          throws BatchProcessingException
Parameters:
input - Input File
output - Output File
Throws:
BatchProcessingException
Method Detail

getReader

protected org.openscience.cdk.io.iterator.IIteratingChemObjectReader getReader(FileState file,
                                                                               boolean monitor)
                                                                        throws BatchProcessingException
Throws:
BatchProcessingException

openInputFile

public void openInputFile()
                   throws BatchProcessingException
Opens the input file as set by constructor and creates IteratingChemObjectReader

Specified by:
openInputFile in interface IBatchProcessing
Overrides:
openInputFile in class BatchProcessing
Throws:
BatchProcessingException

createOutputFile

public void createOutputFile()
                      throws BatchProcessingException
Creates ChemObjectWriter

Specified by:
createOutputFile in interface IBatchProcessing
Overrides:
createOutputFile in class BatchProcessing
Throws:
BatchProcessingException

start

public void start()
           throws BatchProcessingException
Specified by:
start in interface IBatchProcessing
Overrides:
start in class BatchProcessing
Throws:
BatchProcessingException

closeInputFile

public void closeInputFile()
                    throws BatchProcessingException
Throws:
BatchProcessingException

closeOutputFile

public void closeOutputFile()
                     throws BatchProcessingException
Throws:
BatchProcessingException

processRecord

public void processRecord()
                   throws BatchProcessingException
Throws:
BatchProcessingException

readRecord

public void readRecord()
                throws BatchProcessingException
Throws:
BatchProcessingException

writeRecord

public void writeRecord()
                 throws BatchProcessingException
Throws:
BatchProcessingException

hasNextRecord

public boolean hasNextRecord()


Copyright © 2004-2012 Ideaconsult Ltd.. All Rights Reserved.