@PublicAPI public class StripSaltsAction extends AbstractStandardizerAction
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SALT_DICTIONARY_PATH
Default salt dictionary file path.
|
static java.lang.String |
DONT_REMOVE_LAST_COMPONENT_KEY
Property key for "Don't Remove Last Component" option
|
static java.lang.String |
SALT_ID_PROPERTY
Property key for salt ID
|
static java.lang.String |
SALT_LIST_KEY
Property key for salt list modification
|
static java.lang.String |
USE_DEFAULT_SALTS_KEY
Property key for use default salts modification
|
CONFIG_PATH_KEY, FORMAT_KEY, ID_KEY, support
Constructor and Description |
---|
StripSaltsAction(java.util.Map<java.lang.String,java.lang.String> params)
Initializes strip salts action
|
Modifier and Type | Method and Description |
---|---|
void |
addSalt(java.lang.String saltID,
Molecule molecule)
Adds a salt to the salt list of the action
|
StripSaltsAction |
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 |
getSaltCount()
Gets the count of the salts of the action
|
java.lang.String |
getSaltID(int index)
Gets the salt ID at the provided index
|
java.util.List<Molecule> |
getSaltList()
Gets the custom salt list of the action
|
boolean |
isDontRemoveLastComponent() |
boolean |
isUseDefaultSalts()
Gets whether default salt dictionary should be used
|
static java.util.List<Molecule> |
readSaltDictionary()
Reads the default salt dictionary.
|
void |
removeAllSalts()
Removes all salts from the salt list of the action.
|
void |
removeSalt(int index)
Removes a salt from the salt list of the action
|
void |
removeSalts(int... indexes)
Removes a salt from the salt list of the action
|
void |
setDontRemoveLastComponent(boolean dontRemoveLastComponent) |
void |
setMolecule(int index,
Molecule molecule)
Sets the molecule of the salt at the provided index
|
void |
setSaltID(int index,
java.lang.String saltID)
Sets the name of the salt at the provided index
|
void |
setUseDefaultSalts(boolean useDefaultSalts)
Sets whether default salt 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 SALT_LIST_KEY
public static final java.lang.String USE_DEFAULT_SALTS_KEY
public static final java.lang.String DONT_REMOVE_LAST_COMPONENT_KEY
public static final java.lang.String DEFAULT_SALT_DICTIONARY_PATH
public static final java.lang.String SALT_ID_PROPERTY
public StripSaltsAction(java.util.Map<java.lang.String,java.lang.String> params)
params
- the parameters of the actionpublic boolean isUseDefaultSalts()
public void setUseDefaultSalts(boolean useDefaultSalts)
useDefaultSalts
- whether default salt dictionary should be usedpublic void addSalt(java.lang.String saltID, Molecule molecule)
saltID
- saltID of the saltmolecule
- the molecule of the saltpublic void setSaltID(int index, java.lang.String saltID)
index
- the target indexsaltID
- the saltID to be setpublic boolean isDontRemoveLastComponent()
public void setDontRemoveLastComponent(boolean dontRemoveLastComponent)
public void setMolecule(int index, Molecule molecule)
index
- the target indexmolecule
- the molecule to be setpublic int getSaltCount()
public Molecule getMolecule(int index)
index
- the required indexpublic java.lang.String getSaltID(int index)
index
- the required indexpublic void removeSalt(int index)
index
- index of the salt to be removedpublic void removeSalts(int... indexes)
indexes
- indexes of the salts to be removedpublic void removeAllSalts()
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> readSaltDictionary()
public java.util.List<Molecule> getSaltList()
public StripSaltsAction 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