Class RemoveSolventsAction
- java.lang.Object
-
- chemaxon.standardizer.AbstractStandardizerAction
-
- chemaxon.standardizer.advancedactions.RemoveSolventsAction
-
- All Implemented Interfaces:
chemaxon.license.Licensable
,StandardizerAction
,PropertyChangeListener
,Cloneable
,EventListener
@PublicAPI public class RemoveSolventsAction extends AbstractStandardizerAction
Remove solvents standardizer action.Additional solvents can be added in action string. Example configuration:
"removesolvents:benzene='c1ccccc1':water='[#8]'"
- Since:
- 6.4
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_SOLVENT_DICTIONARY_PATH
Default solvent dictionary file path.static String
SOLVENT_ID_PROPERTY
Property key for solvent IDstatic String
SOLVENT_LIST_KEY
Property key for solvent list modificationstatic String
USE_DEFAULT_SOLVENTS_KEY
Property key for use default solvent modification-
Fields inherited from class chemaxon.standardizer.AbstractStandardizerAction
CONFIG_PATH_KEY, FORMAT_KEY, ID_KEY, support
-
-
Constructor Summary
Constructors Constructor Description RemoveSolventsAction(Map<String,String> params)
Initializes remove solvents action
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSolvent(String solventID, Molecule molecule)
Adds a solvent to the solvent list of the actionRemoveSolventsAction
clone()
protected List<Molecule>
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.Molecule
getMolecule(int index)
Gets the molecule at the provided indexint
getSolventCount()
Gets the count of the solvents of the actionString
getSolventID(int index)
Gets the solvent ID at the provided indexList<Molecule>
getSolventList()
Gets the custom solvent list of the actionboolean
isUseDefaultSolvents()
Gets whether default solvent dictionary should be usedstatic List<Molecule>
readSolventDictionary()
Reads the default solvent dictionary.void
removeAllSolvents()
Removes all solvents from the solvents list of the action.void
removeSolvent(int index)
Removes a solvent from the solvent list of the actionvoid
removeSolvents(int... indexes)
Removes a solvent from the solvent list of the actionvoid
setMolecule(int index, Molecule molecule)
Sets the molecule of the solvent at the provided indexvoid
setSolventID(int index, String solventID)
Sets the name of the solvent at the provided indexvoid
setUseDefaultSolvents(boolean useDefaultSolvents)
Sets whether default solvent dictionary should be usedprotected Changes
standardize1(Molecule molecule)
This method contains the current standardization mechanism.String
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 Detail
-
SOLVENT_LIST_KEY
public static final String SOLVENT_LIST_KEY
Property key for solvent list modification- See Also:
- Constant Field Values
-
USE_DEFAULT_SOLVENTS_KEY
public static final String USE_DEFAULT_SOLVENTS_KEY
Property key for use default solvent modification- See Also:
- Constant Field Values
-
DEFAULT_SOLVENT_DICTIONARY_PATH
public static final String DEFAULT_SOLVENT_DICTIONARY_PATH
Default solvent dictionary file path.- See Also:
- Constant Field Values
-
SOLVENT_ID_PROPERTY
public static final String SOLVENT_ID_PROPERTY
Property key for solvent ID- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public void addSolvent(String solventID, Molecule molecule)
Adds a solvent to the solvent list of the action- Parameters:
solventID
- solvent ID of the solventmolecule
- the molecule of the solvent
-
setSolventID
public void setSolventID(int index, String solventID)
Sets the name of the solvent at the provided index- Parameters:
index
- the target indexsolventID
- the solventID to be set
-
setMolecule
public void setMolecule(int index, Molecule molecule)
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
public Molecule getMolecule(int index)
Gets the molecule at the provided index- Parameters:
index
- the required index- Returns:
- the molecule at the provided index
-
getSolventID
public String getSolventID(int index)
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
protected Changes standardize1(Molecule molecule) throws IllegalArgumentException
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
-
readSolventDictionary
public static final List<Molecule> readSolventDictionary()
Reads the default solvent dictionary. The name of the solvent will be the name of the molecule- Returns:
- the default solvent dictionary
-
getSolventList
public List<Molecule> getSolventList()
Gets the custom solvent list of the action- Returns:
- the custom solvent list of the action
-
clone
public RemoveSolventsAction clone() throws CloneNotSupportedException
- Overrides:
clone
in classAbstractStandardizerAction
- Throws:
CloneNotSupportedException
-
toString
public String toString()
- Overrides:
toString
in classAbstractStandardizerAction
-
getComponents
protected List<Molecule> getComponents(Molecule molecule)
Description copied from class:AbstractStandardizerAction
A 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:
getComponents
in classAbstractStandardizerAction
- Parameters:
molecule
- the target molecule- Returns:
- the resulted list of components
-
-