Class RemoveSolventsAction

    • 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
    • Constructor Detail

      • RemoveSolventsAction

        public RemoveSolventsAction​(Map<String,​String> params)
        Initializes remove solvents action
        Parameters:
        params - the parameters of the action
    • 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 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.
      • 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
      • 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