Class RemoveSolventsAction
java.lang.Object
chemaxon.standardizer.AbstractStandardizerAction
chemaxon.standardizer.advancedactions.RemoveSolventsAction
- All Implemented Interfaces:
chemaxon.license.Licensable,StandardizerAction,PropertyChangeListener,Cloneable,EventListener
Remove solvents standardizer action.
Additional solvents can be added in action string.
Example configuration: "removesolvents:benzene='c1ccccc1':water='[#8]'"
- Since:
- 6.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault solvent dictionary file path.static final StringProperty key for solvent IDstatic final StringProperty key for solvent list modificationstatic final StringProperty key for use default solvent modificationFields inherited from class chemaxon.standardizer.AbstractStandardizerAction
CONFIG_PATH_KEY, FORMAT_KEY, ID_KEY, support -
Constructor Summary
ConstructorsConstructorDescriptionRemoveSolventsAction(Map<String, String> params) Initializes remove solvents action -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSolvent(String solventID, Molecule molecule) Adds a solvent to the solvent list of the actionclone()getComponents(Molecule molecule) A recursive algorithm getting all components (reactants, agents and products of reaction molecules, R-group definitions of Rg-Molecules) of the molecule.getMolecule(int index) Gets the molecule at the provided indexintGets the count of the solvents of the actiongetSolventID(int index) Gets the solvent ID at the provided indexGets the custom solvent list of the actionbooleanGets whether default solvent dictionary should be usedReads the default solvent dictionary.voidRemoves all solvents from the solvents list of the action.voidremoveSolvent(int index) Removes a solvent from the solvent list of the actionvoidremoveSolvents(int... indexes) Removes a solvent from the solvent list of the actionvoidsetMolecule(int index, Molecule molecule) Sets the molecule of the solvent at the provided indexvoidsetSolventID(int index, String solventID) Sets the name of the solvent at the provided indexvoidsetUseDefaultSolvents(boolean useDefaultSolvents) Sets whether default solvent dictionary should be usedprotected Changesstandardize1(Molecule molecule) This method contains the current standardization mechanism.toString()Methods inherited from class chemaxon.standardizer.AbstractStandardizerAction
addPropertyChangeListener, addPropertyChangeListener, anyBooleanPropertyTrue, cloneItem, getDescriptor, getID, isActive, isAvailable, isLicensed, isValid, propertyChange, removePropertyChangeListener, removePropertyChangeListener, setActive, setID, setLicenseEnvironment, setValid, standardize
-
Field Details
-
SOLVENT_LIST_KEY
Property key for solvent list modification- See Also:
-
USE_DEFAULT_SOLVENTS_KEY
Property key for use default solvent modification- See Also:
-
DEFAULT_SOLVENT_DICTIONARY_PATH
Default solvent dictionary file path.- See Also:
-
SOLVENT_ID_PROPERTY
Property key for solvent ID- See Also:
-
-
Constructor Details
-
RemoveSolventsAction
Initializes remove solvents action- Parameters:
params- the parameters of the action
-
-
Method Details
-
isUseDefaultSolvents
public boolean isUseDefaultSolvents()Gets whether default solvent dictionary should be used- Returns:
- whether default solvent dictionary should be used
-
setUseDefaultSolvents
public void setUseDefaultSolvents(boolean useDefaultSolvents) Sets whether default solvent dictionary should be used- Parameters:
useDefaultSolvents- whether default solvent dictionary should be used
-
addSolvent
Adds a solvent to the solvent list of the action- Parameters:
solventID- solvent ID of the solventmolecule- the molecule of the solvent
-
setSolventID
Sets the name of the solvent at the provided index- Parameters:
index- the target indexsolventID- the solventID to be set
-
setMolecule
Sets the molecule of the solvent at the provided index- Parameters:
index- the target indexmolecule- the molecule to be set
-
getSolventCount
public int getSolventCount()Gets the count of the solvents of the action- Returns:
- the count of the solvents of the action
-
getMolecule
Gets the molecule at the provided index- Parameters:
index- the required index- Returns:
- the molecule at the provided index
-
getSolventID
Gets the solvent ID at the provided index- Parameters:
index- the required index- Returns:
- the solvent ID at the provided index
-
removeSolvent
public void removeSolvent(int index) Removes a solvent from the solvent list of the action- Parameters:
index- index of the solvent to be removed
-
removeSolvents
public void removeSolvents(int... indexes) Removes a solvent from the solvent list of the action- Parameters:
indexes- indexes of the solvents to be removed
-
removeAllSolvents
public void removeAllSolvents()Removes all solvents from the solvents list of the action. -
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
-
readSolventDictionary
Reads the default solvent dictionary. The name of the solvent will be the name of the molecule- Returns:
- the default solvent dictionary
-
getSolventList
Gets the custom solvent list of the action- Returns:
- the custom solvent list of the action
-
clone
- Overrides:
clonein classAbstractStandardizerAction- Throws:
CloneNotSupportedException
-
toString
- Overrides:
toStringin classAbstractStandardizerAction
-
getComponents
Description copied from class:AbstractStandardizerActionA recursive algorithm getting all components (reactants, agents and products of reaction molecules, R-group definitions of Rg-Molecules) of the molecule. Used to collect all. If components must not be standardized, this method should be overridden.- Overrides:
getComponentsin classAbstractStandardizerAction- Parameters:
molecule- the target molecule- Returns:
- the resulted list of components
-