chemaxon.checkers.runner
Class AdvancedCheckerRunner

java.lang.Object
  extended by chemaxon.checkers.runner.BasicCheckerRunner
      extended by chemaxon.checkers.runner.AdvancedCheckerRunner
All Implemented Interfaces:
CheckerRunner

public class AdvancedCheckerRunner
extends BasicCheckerRunner

CheckerRunner implementation with advanced fixing capabilities.
StructureFixer selection is based on provided fixer class if available, or falls back to StructureCheckerResult based selection.
Supports multiple iterations of checking and fixing for the best fixing efforts.

Since:
5.7
Version:
5.9
Author:
Istvan Rabel

Field Summary
protected  boolean fallBackToBasic
          indicates that fix should fall back to super fix, or not
protected  chemaxon.checkers.logger.StructureCheckerLogger logger
           
 
Fields inherited from class chemaxon.checkers.runner.BasicCheckerRunner
backgroundThread, molecule
 
Constructor Summary
AdvancedCheckerRunner(ConfigurationReader configurationReader)
          Constructs CheckerRunner with more advanced fixing capabilities.
 
Method Summary
 void check()
          Invoke a background thread which will run all checkers on the given molecule
 java.util.List<StructureCheckerResult> checkAndWait()
          Execute all the checker instances on the given molecule and return a List of StructureCheckerResult which contains all the identified problems
 boolean fix()
          Checks the structure, then fixes the problems based on configuration.
protected  boolean fix(StructureChecker checker, StructureCheckerResult result)
          Tries to fix the problem detected by the specified checker, or falls back to result based behavior.
 chemaxon.checkers.logger.StructureCheckerLogger getLogger()
          Returns the current logger.
 void setLogger(chemaxon.checkers.logger.StructureCheckerLogger logger)
          Sets the logger.
 void setMolecule(Molecule molecule)
          Sets the molecule to be checked by the checkers
 
Methods inherited from class chemaxon.checkers.runner.BasicCheckerRunner
addPropertyChangeListener, addPropertyChangeListener, cancel, convertResult, fix, getChangeSupport, getCheckerConfiguration, getCheckerList, getCurrent, getCurrentCheckerName, getFixers, getIndex, getMolecule, getProgessLength, getResultList, getStrategy, isCanceled, isChecking, isDoodle, setCanceled, setChangeSupport, setCheckerList, setConfigurationReader, setDoodle, setIgnoreConfigurationErrors, setIndex, setResultList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected chemaxon.checkers.logger.StructureCheckerLogger logger

fallBackToBasic

protected boolean fallBackToBasic
indicates that fix should fall back to super fix, or not

Constructor Detail

AdvancedCheckerRunner

public AdvancedCheckerRunner(ConfigurationReader configurationReader)
Constructs CheckerRunner with more advanced fixing capabilities.

Parameters:
configurationReader - the checker configuration
Method Detail

fix

protected boolean fix(StructureChecker checker,
                      StructureCheckerResult result)
Tries to fix the problem detected by the specified checker, or falls back to result based behavior. NOTE: if FixMode is different from FixMode.FIX, no fixing attempt will be performed.

Parameters:
checker - the checker that detected the problem
result - the result of check
Returns:
true if problem is fixed

fix

public boolean fix()
Checks the structure, then fixes the problems based on configuration.
NOTE: FixMode and fixerClassName from configuration is used to choose best fixer. Checkers with FixMode FixMode.ASK will not be fixed. Runs multiple iterations for best fix results.

Specified by:
fix in interface CheckerRunner
Overrides:
fix in class BasicCheckerRunner
Returns:
true if the fix ended correctly false otherwise

checkAndWait

public java.util.List<StructureCheckerResult> checkAndWait()
Description copied from interface: CheckerRunner
Execute all the checker instances on the given molecule and return a List of StructureCheckerResult which contains all the identified problems

Specified by:
checkAndWait in interface CheckerRunner
Overrides:
checkAndWait in class BasicCheckerRunner
Returns:
a List of StructureCheckerResult which contains all the identified problem about the given molecule

check

public void check()
Description copied from interface: CheckerRunner
Invoke a background thread which will run all checkers on the given molecule

Specified by:
check in interface CheckerRunner
Overrides:
check in class BasicCheckerRunner

setMolecule

public void setMolecule(Molecule molecule)
Description copied from interface: CheckerRunner
Sets the molecule to be checked by the checkers

Specified by:
setMolecule in interface CheckerRunner
Overrides:
setMolecule in class BasicCheckerRunner
Parameters:
molecule - a Molecule instance to be checked

getLogger

public chemaxon.checkers.logger.StructureCheckerLogger getLogger()
Returns the current logger.

Returns:
the current logger

setLogger

public void setLogger(chemaxon.checkers.logger.StructureCheckerLogger logger)
Sets the logger.

Parameters:
logger - the new logger