Package chemaxon.checkers
Class SubstructureChecker
- java.lang.Object
-
- chemaxon.checkers.AbstractStructureChecker
-
- chemaxon.checkers.SubstructureChecker
-
- All Implemented Interfaces:
StructureChecker
,chemaxon.license.Licensable
,PropertyChangeListener
,Cloneable
,EventListener
@PublicAPI public class SubstructureChecker extends AbstractStructureChecker
This descendant ofAbstractStructureChecker
is responsible for detecting substructures in aMolecule
instance. Query has to be given as a reaction smarts (reactant->product type)- Since:
- JChem 5.5, Marvin 5.6
-
-
Field Summary
-
Fields inherited from class chemaxon.checkers.AbstractStructureChecker
errorType, propertyChangeSupport
-
Fields inherited from interface chemaxon.checkers.StructureChecker
PROPERTY_KEY_VALID
-
-
Constructor Summary
Constructors Constructor Description SubstructureChecker()
Default constructor.SubstructureChecker(String areactionSmarts)
Parameterized constructor.SubstructureChecker(Map<String,String> params)
Parameterized constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StructureCheckerResult
check1(Molecule molecule)
This method contains the current checking mechanism.SubstructureChecker
clone()
StructureCheckerErrorType
getErrorType()
String
getReactionSmarts()
Returns the reactionSmartsboolean
isAvailable()
Returns true if the checker is available, and can be usedboolean
isValid()
Returns true if the checker's configuration is valid, false otherwisevoid
setReactionSmarts(String reactionSmarts)
Sets the reactionSmartsString
toString()
-
Methods inherited from class chemaxon.checkers.AbstractStructureChecker
addPropertyChangeListener, addPropertyChangeListener, check, cloneItem, convertResult, equals, expandMolecule, getDescription, getDescriptor, getEditorClassName, getErrorCode, getErrorDescription, getHelpText, getIcon, getLocalMenuName, getName, hashCode, isLicensed, propertyChange, removePropertyChangeListener, removePropertyChangeListener, setDescription, setHelpText, setIcon, setLicenseEnvironment, setLocalMenuName, setMoreErrorMessage, setName, setNoErrorMessage, setOneErrorMessage
-
-
-
-
Constructor Detail
-
SubstructureChecker
public SubstructureChecker()
Default constructor. Calling this constructor developer has to set explicitly the needed smarts reaction directly.
-
SubstructureChecker
public SubstructureChecker(Map<String,String> params)
Parameterized constructor. If the reactionsmarts parameter given it sets the reaction smarts property.- Parameters:
params
- aMap
instance which contains String pairs. Key is the name of the parameter.
-
SubstructureChecker
public SubstructureChecker(String areactionSmarts) throws MolFormatException
Parameterized constructor.- Parameters:
areactionSmarts
- is the s- Throws:
MolFormatException
- when the given smarts string could not be recognized
-
-
Method Detail
-
getReactionSmarts
public String getReactionSmarts()
Returns the reactionSmarts- Returns:
- the reactionSmarts
-
setReactionSmarts
public void setReactionSmarts(String reactionSmarts) throws MolFormatException
Sets the reactionSmarts- Parameters:
reactionSmarts
- the reactionSmarts to set. If reaction smarts is an empty string the change is ignored.- Throws:
MolFormatException
- when the given smarts string could not be recognized
-
getErrorType
public StructureCheckerErrorType getErrorType()
- Specified by:
getErrorType
in interfaceStructureChecker
- Overrides:
getErrorType
in classAbstractStructureChecker
- Returns:
- the error type of this checker
-
check1
protected StructureCheckerResult check1(Molecule molecule)
Description copied from class:AbstractStructureChecker
This method contains the current checking mechanism.- Specified by:
check1
in classAbstractStructureChecker
- Parameters:
molecule
- theMolecule
instance to be checked for problems- Returns:
- a
StructureCheckerResult
which represents the problem or null if no problem found
-
isValid
public boolean isValid()
Description copied from interface:StructureChecker
Returns true if the checker's configuration is valid, false otherwise- Specified by:
isValid
in interfaceStructureChecker
- Overrides:
isValid
in classAbstractStructureChecker
- Returns:
- true if the checker's configuration is valid, false otherwise
-
isAvailable
public boolean isAvailable()
Description copied from interface:StructureChecker
Returns true if the checker is available, and can be used- Specified by:
isAvailable
in interfaceStructureChecker
- Overrides:
isAvailable
in classAbstractStructureChecker
- Returns:
- true if the checker is available, and can be used
-
clone
public SubstructureChecker clone() throws CloneNotSupportedException
- Overrides:
clone
in classAbstractStructureChecker
- Throws:
CloneNotSupportedException
-
toString
public String toString()
- Overrides:
toString
in classAbstractStructureChecker
-
-