Class StripSaltsAction

    • Field Detail

      • USE_DEFAULT_SALTS_KEY

        public static final String USE_DEFAULT_SALTS_KEY
        Property key for use default salts modification
        See Also:
        Constant Field Values
      • DONT_REMOVE_LAST_COMPONENT_KEY

        public static final String DONT_REMOVE_LAST_COMPONENT_KEY
        Property key for "Don't Remove Last Component" option
        See Also:
        Constant Field Values
      • DEFAULT_SALT_DICTIONARY_PATH

        public static final String DEFAULT_SALT_DICTIONARY_PATH
        Default salt dictionary file path.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StripSaltsAction

        public StripSaltsAction​(Map<String,​String> params)
        Initializes strip salts action
        Parameters:
        params - the parameters of the action
    • Method Detail

      • isUseDefaultSalts

        public boolean isUseDefaultSalts()
        Gets whether default salt dictionary should be used
        Returns:
        whether default salt dictionary should be used
      • setUseDefaultSalts

        public void setUseDefaultSalts​(boolean useDefaultSalts)
        Sets whether default salt dictionary should be used
        Parameters:
        useDefaultSalts - whether default salt dictionary should be used
      • addSalt

        public void addSalt​(String saltID,
                            Molecule molecule)
        Adds a salt to the salt list of the action
        Parameters:
        saltID - saltID of the salt
        molecule - the molecule of the salt
      • setSaltID

        public void setSaltID​(int index,
                              String saltID)
        Sets the name of the salt at the provided index
        Parameters:
        index - the target index
        saltID - the saltID to be set
      • isDontRemoveLastComponent

        public boolean isDontRemoveLastComponent()
      • setDontRemoveLastComponent

        public void setDontRemoveLastComponent​(boolean dontRemoveLastComponent)
      • setMolecule

        public void setMolecule​(int index,
                                Molecule molecule)
        Sets the molecule of the salt at the provided index
        Parameters:
        index - the target index
        molecule - the molecule to be set
      • getSaltCount

        public int getSaltCount()
        Gets the count of the salts of the action
        Returns:
        the count of the salts 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
      • getSaltID

        public String getSaltID​(int index)
        Gets the salt ID at the provided index
        Parameters:
        index - the required index
        Returns:
        the salt ID at the provided index
      • removeSalt

        public void removeSalt​(int index)
        Removes a salt from the salt list of the action
        Parameters:
        index - index of the salt to be removed
      • removeSalts

        public void removeSalts​(int... indexes)
        Removes a salt from the salt list of the action
        Parameters:
        indexes - indexes of the salts to be removed
      • removeAllSalts

        public void removeAllSalts()
        Removes all salts from the salt list of the action.
      • readSaltDictionary

        public static final List<Molecule> readSaltDictionary()
        Reads the default salt dictionary. The name of the salt will be the name of the molecule
        Returns:
        the default salt dictionary
      • getSaltList

        public List<Molecule> getSaltList()
        Gets the custom salt list of the action
        Returns:
        the custom salt 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