Package chemaxon.checkers.runner
Interface CheckerRunner
-
- All Known Implementing Classes:
AdvancedCheckerRunner
,chemaxon.checkers.runner.BasicCheckerRunner
,SketchCheckerRunner
@PublicAPI public interface CheckerRunner
The descendant of CheckerRunner interface has to provide the functionality to runStructureChecker
instances automatically
on the given molecule and fix the problems with the associatedStructureFixer
instances.
Example:
CheckerRunner can be used directly with thecheckAndWait
method. This method returns aList
ofStructureCheckerResult
which contains all the identified problem of the given molecule. CheckerRunner can return all theStructureFixer
instances
for aStructureCheckerResult
. These fixers can be executed one by one.
CheckerRunner runner;
... (initialize/initiate the current CheckerRunner instance)
Listresults = runner.checkAndWait();
for (StructureChecekrResult result : results) {
Listfixers = runner.getFixers(result);
... execute one of the fixers
}
CheckerRunner supports executing the default fixer of aStructureCheckerResult
.
CheckerRunner runner;
... (initialize/initiate the current CheckerRunner instance)
Listresults = runner.checkAndWait();
for (StructureCheckerResult result : results) {
runner.fix(result);
}
CheckerRunner supports running the checkers in background thread with thecheck()
method. After the background thread is ended (isChecking()
returns false or "checking" property changed fired) the usage is the same. CheckerRunner provides support to try to identify all the problems in the given molecule and fix these problems with the default fixer using thefix()
method.- Since:
- Marvin 5.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener changeListener)
Adds aPropertyChangeListener
that will receive all thePropertyChangeEvent
fired by this classvoid
addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Adds aPropertyChangeListener
that will receive thePropertyChangeEvent
fired when the property with the given name is changedvoid
cancel()
Stops the background threadvoid
check()
Invokes a background thread which will run all checkers on the given moleculeList<StructureCheckerResult>
checkAndWait()
Executes all the checker instances on the given molecule and returns aList
ofStructureCheckerResult
containing all the identified problemsboolean
fix()
Runs allStructureChecker
on the given molecule and after that fixes all identified problems with the firstStructureFixer
which is associated with the current problem.boolean
fix(StructureCheckerResult result)
Fixes the problem identified by result with the firstStructureFixer
which is associated with theStructureCheckerErrorType
of the result.List<StructureChecker>
getCheckerConfiguration()
Gets the list of available checkersint
getCurrent()
String
getCurrentCheckerName()
List<StructureFixer>
getFixers(StructureCheckerResult result)
Returns all theStructureFixer
instances which associated with theStructureCheckerErrorType
of the resultint
getProgessLength()
List<StructureCheckerResult>
getResultList()
boolean
isChecking()
This function identifies the state of the checker threadvoid
setConfigurationReader(ConfigurationReader reader)
Sets a new configuration for the Runner.void
setIgnoreConfigurationErrors(boolean ignore)
Sets whether configuration errors should be ignored on execution.void
setMolecule(Molecule molecule)
Sets the molecule to be checked by the checkers
-
-
-
Method Detail
-
setConfigurationReader
void setConfigurationReader(ConfigurationReader reader)
Sets a new configuration for the Runner.- Parameters:
reader
- is theConfigurationReader
instance which provides the current configuraiton- Since:
- 5.4
-
check
void check()
Invokes a background thread which will run all checkers on the given molecule
-
checkAndWait
List<StructureCheckerResult> checkAndWait()
Executes all the checker instances on the given molecule and returns aList
ofStructureCheckerResult
containing all the identified problems- Returns:
- a
List
ofStructureCheckerResult
containing all the identified problem about the given molecule
-
cancel
void cancel()
Stops the background thread
-
isChecking
boolean isChecking()
This function identifies the state of the checker thread- Returns:
- true if the background thread runs false otherwise
-
getCurrent
int getCurrent()
- Returns:
- the current progress percent
-
getCurrentCheckerName
String getCurrentCheckerName()
- Returns:
- which
StructureChecker
instance run currently
-
getProgessLength
int getProgessLength()
- Returns:
- the length of the checking process
-
getResultList
List<StructureCheckerResult> getResultList()
- Returns:
- a
List
ofStructureCheckerResult
which contains all the dentified problem about the given molecule
-
getFixers
List<StructureFixer> getFixers(StructureCheckerResult result)
Returns all theStructureFixer
instances which associated with theStructureCheckerErrorType
of the result- Parameters:
result
- aStructureCheckerResult
instance which identifies the current problem- Returns:
- a
List
ofStructureFixer
-
fix
boolean fix()
Runs allStructureChecker
on the given molecule and after that fixes all identified problems with the firstStructureFixer
which is associated with the current problem.- Returns:
- true if the fix ended correctly false otherwise
-
fix
boolean fix(StructureCheckerResult result)
Fixes the problem identified by result with the firstStructureFixer
which is associated with theStructureCheckerErrorType
of the result.- Parameters:
result
- aStructureCheckerResult
instance which identifies the problem- Returns:
- true if the fix ended correctly false otherwise
-
setMolecule
void setMolecule(Molecule molecule)
Sets the molecule to be checked by the checkers- Parameters:
molecule
- aMolecule
instance to be checked
-
addPropertyChangeListener
void addPropertyChangeListener(PropertyChangeListener changeListener)
Adds aPropertyChangeListener
that will receive all thePropertyChangeEvent
fired by this class- Parameters:
changeListener
- aPropertyChangeListener
instance
-
addPropertyChangeListener
void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Adds aPropertyChangeListener
that will receive thePropertyChangeEvent
fired when the property with the given name is changed- Parameters:
propertyName
- the name of the property to be listenedlistener
- aPropertyChangeListener
instance
-
getCheckerConfiguration
List<StructureChecker> getCheckerConfiguration()
Gets the list of available checkers- Returns:
- the list of available checkers
-
setIgnoreConfigurationErrors
void setIgnoreConfigurationErrors(boolean ignore)
Sets whether configuration errors should be ignored on execution.- Parameters:
ignore
- true if configuration errors should be ignored on execution
-
-