Package chemaxon.standardizer.actions
Class ReplaceAtomsAction
java.lang.Object
chemaxon.standardizer.AbstractStandardizerAction
chemaxon.standardizer.actions.ReplaceAtomsAction
- All Implemented Interfaces:
chemaxon.license.Licensable
,StandardizerAction
,PropertyChangeListener
,Cloneable
,EventListener
Replace atoms standardizer action
- Since:
- 6.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property key for serialization/deserialization an event changes for valence check (boolean value type)static final String
Property key for serialization/deserialization an event changes for query atom (MolAtom value type)static final String
Property key for serialization/deserialization an event changes for replace atom (MolAtom value type)Fields inherited from class chemaxon.standardizer.AbstractStandardizerAction
CONFIG_PATH_KEY, FORMAT_KEY, ID_KEY, support
-
Constructor Summary
ConstructorDescriptionReplaceAtomsAction
(Map<String, String> params) Initializes a replace atom standardizer action -
Method Summary
Modifier and TypeMethodDescriptionclone()
Gets the atom to be searched for by the action (the query atom)Gets the atom to replaced with by the actionboolean
Gets whether replace should be applied even in case of invalid valence in the resultprotected boolean
Matches 2 atomsprotected boolean
Replaces an atom to the replace atom in the target moleculevoid
setAllowValenceError
(boolean allowValenceError) Sets replace should be applied even in case of invalid valence in the resultvoid
setQueryAtom
(MolAtom queryAtom) Sets the atom to be searched for by the action (the query atom)void
setReplaceAtom
(MolAtom replaceAtom) Sets the atom to replaced with by the actionprotected final Changes
standardize1
(Molecule molecule) This method contains the current standardization mechanism.toString()
Methods inherited from class chemaxon.standardizer.AbstractStandardizerAction
addPropertyChangeListener, addPropertyChangeListener, anyBooleanPropertyTrue, cloneItem, getComponents, getDescriptor, getID, isActive, isAvailable, isLicensed, isValid, propertyChange, removePropertyChangeListener, removePropertyChangeListener, setActive, setID, setLicenseEnvironment, setValid, standardize
-
Field Details
-
PROPERTY_KEY_QUERY_ATOM
Property key for serialization/deserialization an event changes for query atom (MolAtom value type)- See Also:
-
PROPERTY_KEY_REPLACE_ATOM
Property key for serialization/deserialization an event changes for replace atom (MolAtom value type)- See Also:
-
PROPERTY_KEY_ALLOW_VALENCE_ERROR
Property key for serialization/deserialization an event changes for valence check (boolean value type)- See Also:
-
-
Constructor Details
-
ReplaceAtomsAction
Initializes a replace atom standardizer action- Parameters:
params
- the parameters of the action
-
-
Method Details
-
standardize1
Description copied from class:AbstractStandardizerAction
This method contains the current standardization mechanism. Descendants needs to implement this method.
Special molecules containing more components (e.g.RgMolecule
,RxnMolecule
) are decomponented by the methodAbstractStandardizerAction.getComponents(Molecule)
, andAbstractStandardizerAction.standardize1(Molecule)
method is called on each component, before applied on the original molecule. If a descendant does not want this to occur, this method must be overridden.
Logs of standardization should be generated to aLogger
, that can be collected by usingStandardizerLogger.getLogger()
method.- Specified by:
standardize1
in classAbstractStandardizerAction
- Parameters:
molecule
- theMolecule
instance to be standardized- Returns:
- the changes applied on the molecule during the standardization process
- Throws:
IllegalArgumentException
- if the provided molecule or the provided parameters of the action are invalid
-
replace
Replaces an atom to the replace atom in the target molecule- Parameters:
atom
- the atom to be replacedreplaceAtom
- the atom to replace withmolecule
- the parent molecule
-
matches
Matches 2 atoms- Parameters:
atom
- the first atomqueryAtom
- the second atom- Returns:
- true if the atoms do match
-
getQueryAtom
Gets the atom to be searched for by the action (the query atom)- Returns:
- the atom to be searched for by the action (the query atom)
-
setQueryAtom
Sets the atom to be searched for by the action (the query atom)- Parameters:
queryAtom
- the atom to be searched for by the action (the query atom)
-
getReplaceAtom
Gets the atom to replaced with by the action- Returns:
- the atom to replaced with by the action
-
setReplaceAtom
Sets the atom to replaced with by the action- Parameters:
replaceAtom
- the atom to replaced with by the action
-
isAllowValenceError
public boolean isAllowValenceError()Gets whether replace should be applied even in case of invalid valence in the result- Returns:
- whether replace should be applied even in case of invalid valence in the result
-
setAllowValenceError
public void setAllowValenceError(boolean allowValenceError) Sets replace should be applied even in case of invalid valence in the result- Parameters:
allowValenceError
- replace should be applied even in case of invalid valence in the result
-
clone
- Overrides:
clone
in classAbstractStandardizerAction
- Throws:
CloneNotSupportedException
-
toString
- Overrides:
toString
in classAbstractStandardizerAction
-