jklustor-overlap-0.0.2-20140619012940 (ChemAxon)


com.chemaxon.overlap.io
Class MoleculeCallbacks.IndexToNameStoringCallback

Object
  extended by com.chemaxon.overlap.io.MoleculeCallbacks.IndexToNameStoringCallback
All Implemented Interfaces:
MoleculeCallback
Enclosing class:
MoleculeCallbacks

public static class MoleculeCallbacks.IndexToNameStoringCallback
extends Object
implements MoleculeCallback

A callback storing indexes.

Note that errors are not stored or reported.


Constructor Summary
MoleculeCallbacks.IndexToNameStoringCallback()
          Construct.
MoleculeCallbacks.IndexToNameStoringCallback(MoleculeCallback with)
          Construct.
 
Method Summary
 ImmutableList<String> getIndexToName()
          Get a clone of index to name association.
 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.
 String toString()
           
 void toStrings(PrintStream ps, com.chemaxon.calculations.common.SubProgressObserver po)
          Print index to name associations into escaped strings.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoleculeCallbacks.IndexToNameStoringCallback

public MoleculeCallbacks.IndexToNameStoringCallback(MoleculeCallback with)
Construct.

Parameters:
with - Callback to also invoke

MoleculeCallbacks.IndexToNameStoringCallback

public MoleculeCallbacks.IndexToNameStoringCallback()
Construct.

Method Detail

notifyMolecule

public void notifyMolecule(int readno,
                           Optional<String> molString,
                           chemaxon.struc.Molecule m,
                           int index)
Description copied from interface: MoleculeCallback
Introduce new processed molecule.

Specified by:
notifyMolecule in interface MoleculeCallback
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

public void notifyProcessingError(int readno,
                                  Optional<String> molString,
                                  chemaxon.struc.Molecule m,
                                  Throwable t)
Description copied from interface: MoleculeCallback
Notify a processing error.

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

Specified by:
notifyProcessingError in interface MoleculeCallback
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

public void notifyParseError(int readno,
                             Optional<String> molString,
                             Throwable t)
Description copied from interface: MoleculeCallback
Notify a parsing error.

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

Specified by:
notifyParseError in interface MoleculeCallback
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

getIndexToName

public ImmutableList<String> getIndexToName()
Get a clone of index to name association.

Note that an ImmutableList is constructed on every invocation which is not cached.

Returns:
Index to name asspcoayopn

toStrings

public void toStrings(PrintStream ps,
                      com.chemaxon.calculations.common.SubProgressObserver po)
Print index to name associations into escaped strings.

Each line will be scaped using StringEscapeUtils.escapeJava(java.lang.String).

Parameters:
ps - Stream to write; will not be closed
po - Progress Observer to track progress; will be closed
Throws:
CancellationException - when cancelled

toString

public String toString()
Overrides:
toString in class Object

jklustor-overlap-0.0.2-20140619012940 (ChemAxon)