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 Details

    • SOLVENT_LIST_KEY

      public static final String SOLVENT_LIST_KEY
      Property key for solvent list modification
      See Also:
    • USE_DEFAULT_SOLVENTS_KEY

      public static final String USE_DEFAULT_SOLVENTS_KEY
      Property key for use default solvent modification
      See Also:
    • DEFAULT_SOLVENT_DICTIONARY_PATH

      public static final String DEFAULT_SOLVENT_DICTIONARY_PATH
      Default solvent dictionary file path.
      See Also:
    • SOLVENT_ID_PROPERTY

      public static final String SOLVENT_ID_PROPERTY
      Property key for solvent ID
      See Also:
  • Constructor Details

    • RemoveSolventsAction

      public RemoveSolventsAction(Map<String,String> params)
      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

      public void addSolvent(String solventID, Molecule molecule)
      Adds a solvent to the solvent list of the action
      Parameters:
      solventID - solvent ID of the solvent
      molecule - 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 index
      solventID - 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 index
      molecule - 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 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.
      Logs of standardization should be generated to a Logger, that can be collected by using StandardizerLogger.getLogger() method.
      Specified by:
      standardize1 in class AbstractStandardizerAction
      Parameters:
      molecule - the Molecule 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 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

      Overrides:
      clone in class AbstractStandardizerAction
      Throws:
      CloneNotSupportedException
    • toString

      public String toString()
      Overrides:
      toString in class AbstractStandardizerAction
    • 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 class AbstractStandardizerAction
      Parameters:
      molecule - the target molecule
      Returns:
      the resulted list of components