@PublicAPI public class RemoveSolventsAction extends AbstractStandardizerAction
"removesolvents:benzene='c1ccccc1':water='[#8]'
"Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SOLVENT_DICTIONARY_PATH
Default solvent dictionary file path.
|
static java.lang.String |
SOLVENT_ID_PROPERTY
Property key for solvent ID
|
static java.lang.String |
SOLVENT_LIST_KEY
Property key for solvent list modification
|
static java.lang.String |
USE_DEFAULT_SOLVENTS_KEY
Property key for use default solvent modification
|
CONFIG_PATH_KEY, FORMAT_KEY, ID_KEY, support
Constructor and Description |
---|
RemoveSolventsAction(java.util.Map<java.lang.String,java.lang.String> params)
Initializes remove solvents action
|
Modifier and Type | Method and Description |
---|---|
void |
addSolvent(java.lang.String solventID,
Molecule molecule)
Adds a solvent to the solvent list of the action
|
RemoveSolventsAction |
clone() |
protected java.util.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 index
|
int |
getSolventCount()
Gets the count of the solvents of the action
|
java.lang.String |
getSolventID(int index)
Gets the solvent ID at the provided index
|
java.util.List<Molecule> |
getSolventList()
Gets the custom solvent list of the action
|
boolean |
isUseDefaultSolvents()
Gets whether default solvent dictionary should be used
|
static java.util.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 action
|
void |
removeSolvents(int... indexes)
Removes a solvent from the solvent list of the action
|
void |
setMolecule(int index,
Molecule molecule)
Sets the molecule of the solvent at the provided index
|
void |
setSolventID(int index,
java.lang.String solventID)
Sets the name of the solvent at the provided index
|
void |
setUseDefaultSolvents(boolean useDefaultSolvents)
Sets whether default solvent dictionary should be used
|
protected Changes |
standardize1(Molecule molecule)
This method contains the current standardization mechanism.
|
java.lang.String |
toString() |
addPropertyChangeListener, addPropertyChangeListener, cloneItem, getDescriptor, getID, isActive, isAvailable, isLicensed, isValid, propertyChange, removePropertyChangeListener, removePropertyChangeListener, setActive, setID, setLicenseEnvironment, setValid, standardize
public static final java.lang.String SOLVENT_LIST_KEY
public static final java.lang.String USE_DEFAULT_SOLVENTS_KEY
public static final java.lang.String DEFAULT_SOLVENT_DICTIONARY_PATH
public static final java.lang.String SOLVENT_ID_PROPERTY
public RemoveSolventsAction(java.util.Map<java.lang.String,java.lang.String> params)
params
- the parameters of the actionpublic boolean isUseDefaultSolvents()
public void setUseDefaultSolvents(boolean useDefaultSolvents)
useDefaultSolvents
- whether default solvent dictionary should be usedpublic void addSolvent(java.lang.String solventID, Molecule molecule)
solventID
- solvent ID of the solventmolecule
- the molecule of the solventpublic void setSolventID(int index, java.lang.String solventID)
index
- the target indexsolventID
- the solventID to be setpublic void setMolecule(int index, Molecule molecule)
index
- the target indexmolecule
- the molecule to be setpublic int getSolventCount()
public Molecule getMolecule(int index)
index
- the required indexpublic java.lang.String getSolventID(int index)
index
- the required indexpublic void removeSolvent(int index)
index
- index of the solvent to be removedpublic void removeSolvents(int... indexes)
indexes
- indexes of the solvents to be removedpublic void removeAllSolvents()
protected Changes standardize1(Molecule molecule) throws java.lang.IllegalArgumentException
AbstractStandardizerAction
RgMolecule
,
RxnMolecule
) are decomponented by the method
AbstractStandardizerAction.getComponents(Molecule)
, and AbstractStandardizerAction.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.Logger
, that can
be collected by using StandardizerLogger.getLogger()
method.standardize1
in class AbstractStandardizerAction
molecule
- the Molecule
instance to be standardizedjava.lang.IllegalArgumentException
- if the provided molecule or the provided parameters of the
action are invalidpublic static final java.util.List<Molecule> readSolventDictionary()
public java.util.List<Molecule> getSolventList()
public RemoveSolventsAction clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractStandardizerAction
java.lang.CloneNotSupportedException
public java.lang.String toString()
toString
in class AbstractStandardizerAction
protected java.util.List<Molecule> getComponents(Molecule molecule)
AbstractStandardizerAction
getComponents
in class AbstractStandardizerAction
molecule
- the target molecule