Class StandardizerRunner

java.lang.Object
chemaxon.standardizer.concurrent.StandardizerRunner

@PublicApi public class StandardizerRunner extends Object
Concurrent executor of the standardizer
Since:
6.0
  • 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)
      Returns an iterator that will wrap the specified iterator and standardizes all molecules.
      IMPORTANT NOTE: in case of StandardizerRunner.ErrorHandlingPolicy.HALT the method Iterator.next() of the resulted molecule iterator may throw IllegalArgumentException, if exception occurred during standardization. The thrown exception wraps the original exception.
      NOTE: the returned iterator not supports Iterator.remove().
      Parameters:
      iterator - the iterator containing the molecules to be standardized
      configuration - the configuration to apply on the iterator
      threadCount - the number of threads to use for standardization
      policy - the error handling policy
      reportPropertyName - 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 of StandardizerRunner.ErrorHandlingPolicy.HALT the method Iterator.next() of the resulted molecule iterator may throw IllegalArgumentException, if exception occurred during standardization. The thrown exception wraps the original exception.
      NOTE: the returned iterator not supports Iterator.remove().

      NOTE: only use this iterator with try-with-resources statement

      Parameters:
      iterator - the iterator containing the molecules to be standardized
      configuration - the configuration to apply on the iterator
      threadCount - the number of threads to use for standardization
      policy - the error handling policy
      reportPropertyName - 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)
      Returns an iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator not supports Iterator.remove().
      Parameters:
      iterator - the iterator to wrap
      configuration - the configuration to apply on the iterator
      threadCount - the number of threads to use for standardization
      reportPropertyName - 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 supports Iterator.remove().

      NOTE: only use this iterator with try-with-resources statement

      Parameters:
      iterator - the iterator to wrap
      configuration - the configuration to apply on the iterator
      threadCount - the number of threads to use for standardization
      reportPropertyName - 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)
      Returns an iterator that will wrap the specified iterator and standardizes all molecules. NOTE: the returned iterator does not support Iterator.remove().
      Parameters:
      iterator - the iterator to wrap
      configuration - the configuration to apply on the iterator
      threadCount - the number of threads to use for standardization
      reportPropertyName - the name of the property to report applied standardizer actions to
      saveChangeList - sets to save the molecule modifications of each performed standardizer action; if true 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 support Iterator.remove().

      NOTE: only use this iterator with try-with-resources statement

      Parameters:
      iterator - the iterator to wrap
      configuration - the configuration to apply on the iterator
      threadCount - the number of threads to use for standardization
      reportPropertyName - the name of the property to report applied standardizer actions to
      saveChangeList - sets to save the molecule modifications of each performed standardizer action; if true 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 from
      exporter - the exporter to write standardized molecules to
      configuration - the configuration to be applied on the molecules
      threadCount - the number of threads to use for standardization
      policy - the error handling policy
      reportPropertyName - the name of the property to report applied standardizer actions to
      Throws:
      MolExportException - on export failure
      IOException - on export failure
    • evaluate

      protected static Molecule evaluate(StandardizerRunner.ErrorHandlingPolicy policy, StandardizerResult result) throws Exception
      Throws:
      Exception