public class BasicCheckerRunner extends Object implements CheckerRunner
CheckerRunner
interface/Modifier and Type | Field and Description |
---|---|
protected Thread |
backgroundThread |
protected Molecule |
molecule
The
Molecule instance to check |
Constructor and Description |
---|
BasicCheckerRunner(ConfigurationReader configurationReader)
Initiate a
BasicCheckerRunner instance which will can execute
StructureChecker instances read from configurationReader |
BasicCheckerRunner(ConfigurationReader configurationReader,
chemaxon.structurechecker.factory.CheckerFixerFactory checkerFixerFactory)
Initiate a
BasicCheckerRunner instance which will can execute
StructureChecker instances read from configurationReader |
BasicCheckerRunner(ConfigurationReader configurationReader,
StructureFixerFactory fixerFactory)
Deprecated.
|
BasicCheckerRunner(List<StructureChecker> checkerList)
Initiate a
BasicCheckerRunner instance with specified
StructureChecker list. |
BasicCheckerRunner(List<StructureChecker> checkerList,
boolean addFixers)
Initiate a
BasicCheckerRunner instance with specified
StructureChecker list. |
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 |
protected void |
convertResult(StructureCheckerResult result)
This method provides the possibility to convert back the affected
properties of the result if there was any convert in the molecule
structure before check.
|
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. |
protected PropertyChangeSupport |
getChangeSupport()
Returns the changeSupport
|
List<StructureChecker> |
getCheckerConfiguration()
Gets the list of available checkers
|
protected List<StructureChecker> |
getCheckerList()
Returns the checkerList
|
int |
getCurrent() |
String |
getCurrentCheckerName() |
List<StructureFixer> |
getFixers(StructureCheckerResult result)
Returns all the
StructureFixer instances which associated with the
StructureCheckerErrorType of the result |
protected int |
getIndex()
Returns the index
|
protected Molecule |
getMolecule()
Returns the molecule
|
int |
getProgessLength() |
List<StructureCheckerResult> |
getResultList() |
protected Runnable |
getStrategy()
Returns the strategy to use.
|
protected boolean |
isCanceled()
Returns the canceled
|
boolean |
isChecking()
This function identifies the state of the checker thread
|
protected boolean |
isDoodle()
Returns the isDoodle
|
protected void |
setCanceled(boolean canceled)
Sets the canceled
|
protected void |
setChangeSupport(PropertyChangeSupport changeSupport)
Sets the changeSupport
|
protected void |
setCheckerList(List<StructureChecker> checkerList)
Sets the checkerList
|
void |
setConfigurationReader(ConfigurationReader configurationReader)
Sets a new configuration for the Runner.
|
protected void |
setDoodle(boolean isDoodle)
Sets the isDoodle
|
void |
setIgnoreConfigurationErrors(boolean ignore)
Sets whether configuration errors should be ignored on execution.
|
protected void |
setIndex(int index)
Sets the index
|
void |
setMolecule(Molecule molecule)
Sets the molecule to be checked by the checkers
|
protected void |
setResultList(List<StructureCheckerResult> resultList)
Sets the resultList
|
protected Thread backgroundThread
public BasicCheckerRunner(ConfigurationReader configurationReader)
BasicCheckerRunner
instance which will can execute
StructureChecker
instances read from configurationReaderconfigurationReader
- a ConfigurationReader
instance@Deprecated public BasicCheckerRunner(ConfigurationReader configurationReader, StructureFixerFactory fixerFactory)
BasicCheckerRunner(ConfigurationReader, CheckerFixerFactory)
insteadBasicCheckerRunner
instance which will can execute
StructureChecker
instances read from configurationReaderconfigurationReader
- a ConfigurationReader
instancefixerFactory
- the fixer factorypublic BasicCheckerRunner(ConfigurationReader configurationReader, chemaxon.structurechecker.factory.CheckerFixerFactory checkerFixerFactory)
BasicCheckerRunner
instance which will can execute
StructureChecker
instances read from configurationReaderconfigurationReader
- a ConfigurationReader
instancecheckerFixerFactory
- the factory for fixerspublic BasicCheckerRunner(List<StructureChecker> checkerList)
BasicCheckerRunner
instance with specified
StructureChecker
list.checkerList
- the checker listpublic BasicCheckerRunner(List<StructureChecker> checkerList, boolean addFixers)
BasicCheckerRunner
instance with specified
StructureChecker
list.checkerList
- the checker listaddFixers
- whether the default set of fixers should be associated to the
provided checkerspublic void setConfigurationReader(ConfigurationReader configurationReader)
CheckerRunner
setConfigurationReader
in interface CheckerRunner
configurationReader
- is the ConfigurationReader
instance which provides the current configuraitonpublic boolean fix()
CheckerRunner
StructureChecker
on the given molecule and after that fixes all
identified problems with the first StructureFixer
which is associated with the current problem.fix
in interface CheckerRunner
public boolean fix(StructureCheckerResult result)
CheckerRunner
StructureFixer
which
is associated with the StructureCheckerErrorType
of the result.fix
in interface CheckerRunner
result
- a StructureCheckerResult
instance which identifies the problempublic List<StructureFixer> getFixers(StructureCheckerResult result)
CheckerRunner
StructureFixer
instances which associated with the
StructureCheckerErrorType
of the resultgetFixers
in interface CheckerRunner
result
- a StructureCheckerResult
instance which identifies the current problemList
of StructureFixer
public void setMolecule(Molecule molecule)
CheckerRunner
setMolecule
in interface CheckerRunner
molecule
- a Molecule
instance to be checkedpublic void check()
CheckerRunner
check
in interface CheckerRunner
public void cancel()
CheckerRunner
cancel
in interface CheckerRunner
public int getCurrent()
getCurrent
in interface CheckerRunner
public String getCurrentCheckerName()
getCurrentCheckerName
in interface CheckerRunner
StructureChecker
instance run currentlypublic int getProgessLength()
getProgessLength
in interface CheckerRunner
public List<StructureCheckerResult> getResultList()
getResultList
in interface CheckerRunner
List
of StructureCheckerResult
which contains all the
dentified problem about the given moleculepublic boolean isChecking()
CheckerRunner
isChecking
in interface CheckerRunner
public void addPropertyChangeListener(PropertyChangeListener changeListener)
CheckerRunner
PropertyChangeListener
that will receive all the PropertyChangeEvent
fired by this classaddPropertyChangeListener
in interface CheckerRunner
changeListener
- a PropertyChangeListener
instancepublic void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
CheckerRunner
PropertyChangeListener
that will receive the PropertyChangeEvent
fired when the property with
the given name is changedaddPropertyChangeListener
in interface CheckerRunner
propertyName
- the name of the property to be listenedlistener
- a PropertyChangeListener
instancepublic List<StructureCheckerResult> checkAndWait()
CheckerRunner
List
of StructureCheckerResult
which contains all the identified problemscheckAndWait
in interface CheckerRunner
List
of StructureCheckerResult
which contains all the
identified problem about the given moleculeprotected void convertResult(StructureCheckerResult result)
result
- the StructureCheckerResult
instanceprotected Runnable getStrategy()
protected void setCanceled(boolean canceled)
canceled
- the canceled to setprotected boolean isCanceled()
protected void setDoodle(boolean isDoodle)
isDoodle
- the isDoodle to setprotected boolean isDoodle()
protected void setIndex(int index)
index
- the index to setprotected int getIndex()
protected void setResultList(List<StructureCheckerResult> resultList)
resultList
- the resultList to setprotected void setCheckerList(List<StructureChecker> checkerList)
checkerList
- the checkerList to setprotected List<StructureChecker> getCheckerList()
protected Molecule getMolecule()
protected void setChangeSupport(PropertyChangeSupport changeSupport)
changeSupport
- the changeSupport to setprotected PropertyChangeSupport getChangeSupport()
public List<StructureChecker> getCheckerConfiguration()
CheckerRunner
getCheckerConfiguration
in interface CheckerRunner
public void setIgnoreConfigurationErrors(boolean ignore)
CheckerRunner
setIgnoreConfigurationErrors
in interface CheckerRunner
ignore
- true if configuration errors should be ignored on execution