jklustor-overlap-0.0.2-20140619012940 (ChemAxon)


com.chemaxon.overlap.io
Interface Updater<D extends com.chemaxon.descriptors.common.Descriptor>

Type Parameters:
D - Represented descriptor
All Known Implementing Classes:
PagedDescriptorStorage

public interface Updater<D extends com.chemaxon.descriptors.common.Descriptor>

Updater allows the insertion of structures/descriptors to the similarity subsystem.

An updater allows partially filled descriptor space in order to allow incremental/short updates.

Author:
Gabor Imre

Method Summary
 void addAll(InputStream is, String opts, int skipCount, int maxProcessCount, StandardizerWrapper standardizer, com.chemaxon.calculations.common.SubProgressObserver po, ExecutorService e, MoleculeCallback moleculeCallback)
          Read all molecules from a structure file into the similarity subsystem.
 int addDescriptor(D d)
          Add a single descriptor to the similarity subsystem.
 int addMolecule(chemaxon.struc.Molecule m)
          Add a single molecule to the similarity subsystem.
 

Method Detail

addAll

void addAll(InputStream is,
            String opts,
            int skipCount,
            int maxProcessCount,
            StandardizerWrapper standardizer,
            com.chemaxon.calculations.common.SubProgressObserver po,
            ExecutorService e,
            MoleculeCallback moleculeCallback)
Read all molecules from a structure file into the similarity subsystem.

Consecutive members of a structure file have consecutive indexes associated. Usually first molecule in the file have index value 0 associated. To allow segmented reading, this method can be called multiple times to append additional structures.

Consistency considerations: the storage is left in a consistent state in case of the following abnormal or unexpected terminations:

Notes on multithreading:

TODO: shorten parameters list using a builder

Parameters:
is - Input stream to read from. Note that the stream is not closed when returning.
opts - Input options or null to pass to underlying MFileFormatUtil.createRecordReader(java.io.InputStream, java.lang.String)
skipCount - Skip given number of structures. Skipped structures are also reported to the given progress observer like ordinary processed structures, however they wont generate calls into the supplied MoleculeCallback.
maxProcessCount - Read at most given number of structures. Count starts after skipping structures.
standardizer - Standardizer to apply on molecules. See StandardizerWrappers for utility methods. Note that supplied wrapper must be thread safe.
po - ProgressObserver to track file read. Total reported work units are assigned to read and processed/skipped molecules count. The given observer

is closed

upon returning
e - ExecutorService to run descriptor generation for pages
moleculeCallback - Callback to report back assigned indexes/processing errors.
Throws:
IllegalArgumentException - When an IO error occurs during file reading or structure importing throws an exception

addMolecule

int addMolecule(chemaxon.struc.Molecule m)
Add a single molecule to the similarity subsystem.

Note that the given molecule must be standardized before calling this method.

Parameters:
m - Molecule to be added
Returns:
Associated index of the structure
Throws:
IllegalArgumentException - in case of processing error. If exception thrown the storage is kept in a consistent state.

addDescriptor

int addDescriptor(D d)
Add a single descriptor to the similarity subsystem.

Note that descriptors have a compatibility related API contract (currently references returned by Descriptor.getDescriptorGenerator() must be equal for compatible descriptors) which must be satisfied by the passed descriptor.

Parameters:
d - Descriptor to be added
Returns:
Associated index of the represented structure
Throws:
IllegalArgumentException - when passed descriptor is not compatible. If exception thrown the storage is kept in a consistent state

jklustor-overlap-0.0.2-20140619012940 (ChemAxon)