Class ReplaceAtomsAction

    • Field Detail

      • PROPERTY_KEY_QUERY_ATOM

        public static final String PROPERTY_KEY_QUERY_ATOM
        Property key for serialization/deserialization an event changes for query atom (MolAtom value type)
        See Also:
        Constant Field Values
      • PROPERTY_KEY_REPLACE_ATOM

        public static final String PROPERTY_KEY_REPLACE_ATOM
        Property key for serialization/deserialization an event changes for replace atom (MolAtom value type)
        See Also:
        Constant Field Values
      • PROPERTY_KEY_ALLOW_VALENCE_ERROR

        public static final String PROPERTY_KEY_ALLOW_VALENCE_ERROR
        Property key for serialization/deserialization an event changes for valence check (boolean value type)
        See Also:
        Constant Field Values
    • Constructor Detail

      • ReplaceAtomsAction

        public ReplaceAtomsAction​(Map<String,​String> params)
        Initializes a replace atom standardizer action
        Parameters:
        params - the parameters of the action
    • Method Detail

      • replace

        protected boolean replace​(MolAtom atom,
                                  MolAtom replaceAtom,
                                  Molecule molecule)
        Replaces an atom to the replace atom in the target molecule
        Parameters:
        atom - the atom to be replaced
        replaceAtom - the atom to replace with
        molecule - the parent molecule
      • matches

        protected boolean matches​(MolAtom atom,
                                  MolAtom queryAtom)
        Matches 2 atoms
        Parameters:
        atom - the first atom
        queryAtom - the second atom
        Returns:
        true if the atoms do match
      • getQueryAtom

        public MolAtom getQueryAtom()
        Gets the atom to be searched for by the action (the query atom)
        Returns:
        the atom to be searched for by the action (the query atom)
      • setQueryAtom

        public void setQueryAtom​(MolAtom queryAtom)
        Sets the atom to be searched for by the action (the query atom)
        Parameters:
        queryAtom - the atom to be searched for by the action (the query atom)
      • getReplaceAtom

        public MolAtom getReplaceAtom()
        Gets the atom to replaced with by the action
        Returns:
        the atom to replaced with by the action
      • setReplaceAtom

        public void setReplaceAtom​(MolAtom replaceAtom)
        Sets the atom to replaced with by the action
        Parameters:
        replaceAtom - the atom to replaced with by the action
      • isAllowValenceError

        public boolean isAllowValenceError()
        Gets whether replace should be applied even in case of invalid valence in the result
        Returns:
        whether replace should be applied even in case of invalid valence in the result
      • setAllowValenceError

        public void setAllowValenceError​(boolean allowValenceError)
        Sets replace should be applied even in case of invalid valence in the result
        Parameters:
        allowValenceError - replace should be applied even in case of invalid valence in the result