jklustor-overlap-0.0.2-20140619012940 (ChemAxon)


com.chemaxon.overlap.io
Interface MoleculeCallback

All Known Subinterfaces:
MoleculeCallbacks.CountingMoleculeCallback
All Known Implementing Classes:
IdProjectors.IdProjectorMCB, MasterStorages.MoleculeCallbackBuilder, MoleculeCallbacks.IndexToNameStoringCallback, PropertyCollectorCallback

public interface MoleculeCallback

Callback executed on each molecules.

Note that error propagation model is specific to the actual Updater implementation. In case of processing error(s) none, one or all of them might be reported.

Note that MRecordReader based import provides String representation (see MRecord#getMolString(). It is however not necessarily used; for example a MolImporter based implementation is typically unable to supply original String molecule source.

Note that notifyMolecule(int, com.google.common.base.Optional, chemaxon.struc.Molecule, int) is always invoked for successfully processed structures and never for unsuccessfull ones. Method notifyProcessingError(int, com.google.common.base.Optional, chemaxon.struc.Molecule, java.lang.Throwable) is also incvoked when a structure is skipped due to a structure localized processing error. Howeve it is implementation dependent if a parse error is resulting in notifyParseError(int, com.google.common.base.Optional, java.lang.Throwable) or in an abortion.

TODO: rename to ProcessCalback TODO: introduce moleculeParsed method TODO: introduce standardized method, pass change list


Method Summary
 void notifyMolecule(int readno, Optional<String> molString, chemaxon.struc.Molecule m, int index)
          Introduce new processed molecule.
 void notifyParseError(int readno, Optional<String> molString, Throwable t)
          Notify a parsing error.
 void notifyProcessingError(int readno, Optional<String> molString, chemaxon.struc.Molecule m, Throwable t)
          Notify a processing error.
 

Method Detail

notifyMolecule

void notifyMolecule(int readno,
                    Optional<String> molString,
                    chemaxon.struc.Molecule m,
                    int index)
Introduce new processed molecule.

Parameters:
readno - Read molecule count for this event (0 for the first molecule/record in the file). Note that value does not depend on possible index shift value specified for the import method.
molString - Molecule string from underlying MRecord#getMolString() if applicable
m - The given structure. If standardization was specified invocation is made after standardization. In this case the structure represents the standardized structure. In case the descriptor generation alters the molecule the altered molecule is passed.
index - Internal index which will refer to the given structure

notifyProcessingError

void notifyProcessingError(int readno,
                           Optional<String> molString,
                           chemaxon.struc.Molecule m,
                           Throwable t)
Notify a processing error.

This method is invoked when molecule parse was successfull but processing (standardization, descriptor generation, etc. failed

Parameters:
readno - Read molecule count for this event (0 for the first molecule/record in the file). Note that value does not depend on possible index shift value specified for the import method.
molString - Molecule string from underlying MRecord#getMolString() if applicable
m - The given structure when error caught. If standardization was specified and error occured during standardization then the state of the structure (original or partially/fully standardized) depends of the internal contracts realized by Standardizer.
t - Processing error

notifyParseError

void notifyParseError(int readno,
                      Optional<String> molString,
                      Throwable t)
Notify a parsing error.

This method is invoked when molecule parse from String format failed.

Parameters:
readno - Read molecule count for this event (0 for the first molecule/record in the file). Note that value does not depend on possible index shift value specified for the import method.
molString - Molecule string from underlying MRecord#getMolString() if applicable
t - Parsing error

jklustor-overlap-0.0.2-20140619012940 (ChemAxon)