public interface CheckerRunner
StructureChecker
instances automaticallyStructureFixer
instances.checkAndWait
method. This method
returns a List
of StructureCheckerResult
StructureFixer
instancesStructureCheckerResult
. These fixers can be executed one by one.
CheckerRunner runner;
... (initialize/initiate the current CheckerRunner instance)
List results = runner.checkAndWait();
for (StructureChecekrResult result : results) {
List fixers = runner.getFixers(result);
... execute one of the fixers
}
StructureCheckerResult
.
CheckerRunner runner;
... (initialize/initiate the current CheckerRunner instance)
List results = runner.checkAndWait();
for (StructureCheckerResult result : results) {
runner.fix(result);
}
check()
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 the fix()
method.Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener changeListener)
Adds a
PropertyChangeListener that will receive all the PropertyChangeEvent fired by this class |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Adds a
PropertyChangeListener that will receive the PropertyChangeEvent fired when the property with
the given name is changed |
void |
cancel()
Stops the background thread
|
void |
check()
Invoke a background thread which will run all checkers on the given molecule
|
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()
Runs all
StructureChecker on the given molecule and after that fixes all
identified problems with the first StructureFixer which is associated with the current problem. |
boolean |
fix(StructureCheckerResult result)
Fixes the problem identified by result with the first
StructureFixer which
is associated with the StructureCheckerErrorType of the result. |
List<StructureChecker> |
getCheckerConfiguration()
Gets the list of available checkers
|
int |
getCurrent() |
String |
getCurrentCheckerName() |
List<StructureFixer> |
getFixers(StructureCheckerResult result)
Returns all the
StructureFixer instances which associated with the
StructureCheckerErrorType of the result |
int |
getProgessLength() |
List<StructureCheckerResult> |
getResultList() |
boolean |
isChecking()
This function identifies the state of the checker thread
|
void |
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
|
void setConfigurationReader(ConfigurationReader reader)
reader
- is the ConfigurationReader
instance which provides the current configuraitonvoid check()
List<StructureCheckerResult> checkAndWait()
List
of StructureCheckerResult
which contains all the identified problemsList
of StructureCheckerResult
which contains all the
identified problem about the given moleculevoid cancel()
boolean isChecking()
int getCurrent()
String getCurrentCheckerName()
StructureChecker
instance run currentlyint getProgessLength()
List<StructureCheckerResult> getResultList()
List
of StructureCheckerResult
which contains all the
dentified problem about the given moleculeList<StructureFixer> getFixers(StructureCheckerResult result)
StructureFixer
instances which associated with the
StructureCheckerErrorType
of the resultresult
- a StructureCheckerResult
instance which identifies the current problemList
of StructureFixer
boolean fix()
StructureChecker
on the given molecule and after that fixes all
identified problems with the first StructureFixer
which is associated with the current problem.boolean fix(StructureCheckerResult result)
StructureFixer
which
is associated with the StructureCheckerErrorType
of the result.result
- a StructureCheckerResult
instance which identifies the problemvoid setMolecule(Molecule molecule)
molecule
- a Molecule
instance to be checkedvoid addPropertyChangeListener(PropertyChangeListener changeListener)
PropertyChangeListener
that will receive all the PropertyChangeEvent
fired by this classchangeListener
- a PropertyChangeListener
instancevoid addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
PropertyChangeListener
that will receive the PropertyChangeEvent
fired when the property with
the given name is changedpropertyName
- the name of the property to be listenedlistener
- a PropertyChangeListener
instanceList<StructureChecker> getCheckerConfiguration()
void setIgnoreConfigurationErrors(boolean ignore)
ignore
- true if configuration errors should be ignored on execution