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
FieldsModifier and TypeFieldDescriptionstatic final StringProperty key for serialization/deserialization an event changes for valence check (boolean value type)static final StringProperty key for serialization/deserialization an event changes for query atom (MolAtom value type)static final StringProperty 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
ConstructorsConstructorDescriptionReplaceAtomsAction(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 actionbooleanGets whether replace should be applied even in case of invalid valence in the resultprotected booleanMatches 2 atomsprotected booleanReplaces an atom to the replace atom in the target moleculevoidsetAllowValenceError(boolean allowValenceError) Sets replace should be applied even in case of invalid valence in the resultvoidsetQueryAtom(MolAtom queryAtom) Sets the atom to be searched for by the action (the query atom)voidsetReplaceAtom(MolAtom replaceAtom) Sets the atom to replaced with by the actionprotected final Changesstandardize1(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:AbstractStandardizerActionThis 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:
standardize1in classAbstractStandardizerAction- Parameters:
molecule- theMoleculeinstance 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:
clonein classAbstractStandardizerAction- Throws:
CloneNotSupportedException
-
toString
- Overrides:
toStringin classAbstractStandardizerAction
-