Package chemaxon.standardizer.concurrent
Class StandardizerRunner
java.lang.Object
chemaxon.standardizer.concurrent.StandardizerRunner
Concurrent executor of the standardizer
- Since:
- 6.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Policy for error handling -
Method Summary
Modifier and TypeMethodDescriptionstatic CloseableIterator<Molecule>
closeableIterator
(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, StandardizerRunner.ErrorHandlingPolicy policy, String reportPropertyName) Returns an auto-closeable iterator that will wrap the specified iterator and standardizes all molecules.static CloseableIterator<StandardizerResult>
closeableResultIterator
(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName) Returns an auto-closeable iterator that will wrap the specified iterator and standardizes all molecules.static CloseableIterator<StandardizerResult>
closeableResultIterator
(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName, boolean saveChangeList) Returns an auto-closeable iterator that will wrap the specified iterator and standardizes all molecules.protected static Molecule
evaluate
(StandardizerRunner.ErrorHandlingPolicy policy, StandardizerResult result) iterator
(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, StandardizerRunner.ErrorHandlingPolicy policy, String reportPropertyName) Deprecated.static Iterator<StandardizerResult>
resultIterator
(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName) Deprecated.static Iterator<StandardizerResult>
resultIterator
(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName, boolean saveChangeList) Deprecated.static void
standardize
(MolImporter importer, MolExporter exporter, StandardizerConfiguration configuration, int threadCount, StandardizerRunner.ErrorHandlingPolicy policy, String reportPropertyName) Reads the molecules from the importer, standardizes them, and writes to the exporter.
-
Method Details
-
iterator
@Deprecated @SubjectToRemoval(date=JUL_01_2025) public static Iterator<Molecule> iterator(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, StandardizerRunner.ErrorHandlingPolicy policy, String reportPropertyName) Deprecated.Returns an iterator that will wrap the specified iterator and standardizes all molecules.
IMPORTANT NOTE: in case ofStandardizerRunner.ErrorHandlingPolicy.HALT
the methodIterator.next()
of the resulted molecule iterator may throwIllegalArgumentException
, if exception occurred during standardization. The thrown exception wraps the original exception.
NOTE: the returned iterator not supportsIterator.remove()
.- Parameters:
iterator
- the iterator containing the molecules to be standardizedconfiguration
- the configuration to apply on the iteratorthreadCount
- the number of threads to use for standardizationpolicy
- the error handling policyreportPropertyName
- the name of the property to report applied standardizer actions to- Returns:
- an iterator that iterates through the standardized molecules of the original iterator
-
closeableIterator
public static CloseableIterator<Molecule> closeableIterator(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, StandardizerRunner.ErrorHandlingPolicy policy, String reportPropertyName) Returns an auto-closeable iterator that will wrap the specified iterator and standardizes all molecules.
IMPORTANT NOTE: in case ofStandardizerRunner.ErrorHandlingPolicy.HALT
the methodIterator.next()
of the resulted molecule iterator may throwIllegalArgumentException
, if exception occurred during standardization. The thrown exception wraps the original exception.
NOTE: the returned iterator not supportsIterator.remove()
.NOTE: only use this iterator with try-with-resources statement
- Parameters:
iterator
- the iterator containing the molecules to be standardizedconfiguration
- the configuration to apply on the iteratorthreadCount
- the number of threads to use for standardizationpolicy
- the error handling policyreportPropertyName
- the name of the property to report applied standardizer actions to- Returns:
- an auto-closeable iterator that iterates through the standardized molecules of the original iterator
-
resultIterator
@Deprecated @SubjectToRemoval(date=JUL_01_2025) public static Iterator<StandardizerResult> resultIterator(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName) Deprecated.Returns an iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator not supportsIterator.remove()
.- Parameters:
iterator
- the iterator to wrapconfiguration
- the configuration to apply on the iteratorthreadCount
- the number of threads to use for standardizationreportPropertyName
- the name of the property to report applied standardizer actions to- Returns:
- an iterator that iterates through the standardization results of the original iterator
-
closeableResultIterator
public static CloseableIterator<StandardizerResult> closeableResultIterator(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName) Returns an auto-closeable iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator not supportsIterator.remove()
.NOTE: only use this iterator with try-with-resources statement
- Parameters:
iterator
- the iterator to wrapconfiguration
- the configuration to apply on the iteratorthreadCount
- the number of threads to use for standardizationreportPropertyName
- the name of the property to report applied standardizer actions to- Returns:
- an auto-closeable iterator that iterates through the standardization results of the original iterator
-
resultIterator
@Deprecated @SubjectToRemoval(date=JUL_01_2025) public static Iterator<StandardizerResult> resultIterator(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName, boolean saveChangeList) Deprecated.Returns an iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator does not supportIterator.remove()
.- Parameters:
iterator
- the iterator to wrapconfiguration
- the configuration to apply on the iteratorthreadCount
- the number of threads to use for standardizationreportPropertyName
- the name of the property to report applied standardizer actions tosaveChangeList
- sets to save the molecule modifications of each performed standardizer action; iftrue
then the changes will be saved- Returns:
- an iterator that iterates through the standardization results of the original iterator
- Since:
- JChem 6.4
-
closeableResultIterator
public static CloseableIterator<StandardizerResult> closeableResultIterator(Iterator<Molecule> iterator, StandardizerConfiguration configuration, int threadCount, String reportPropertyName, boolean saveChangeList) Returns an auto-closeable iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator does not supportIterator.remove()
.NOTE: only use this iterator with try-with-resources statement
- Parameters:
iterator
- the iterator to wrapconfiguration
- the configuration to apply on the iteratorthreadCount
- the number of threads to use for standardizationreportPropertyName
- the name of the property to report applied standardizer actions tosaveChangeList
- sets to save the molecule modifications of each performed standardizer action; iftrue
then the changes will be saved- Returns:
- an auto-closeable iterator that iterates through the standardization results of the original iterator
- Since:
- JChem 6.4
-
standardize
public static void standardize(MolImporter importer, MolExporter exporter, StandardizerConfiguration configuration, int threadCount, StandardizerRunner.ErrorHandlingPolicy policy, String reportPropertyName) throws MolExportException, IOException Reads the molecules from the importer, standardizes them, and writes to the exporter.- Parameters:
importer
- the importer to read molecules fromexporter
- the exporter to write standardized molecules toconfiguration
- the configuration to be applied on the moleculesthreadCount
- the number of threads to use for standardizationpolicy
- the error handling policyreportPropertyName
- the name of the property to report applied standardizer actions to- Throws:
MolExportException
- on export failureIOException
- on export failure
-
evaluate
protected static Molecule evaluate(StandardizerRunner.ErrorHandlingPolicy policy, StandardizerResult result) throws Exception - Throws:
Exception
-
closeableIterator(Iterator, StandardizerConfiguration, int, ErrorHandlingPolicy, String)
instead