Class SgroupManipulator


  • public final class SgroupManipulator
    extends Object
    Utilities related to Ctab Sgroups.
    • Method Detail

      • copy

        public static List<Sgroup> copy​(Collection<Sgroup> sgroups,
                                        Map<? extends IChemObject,​? extends IChemObject> replace)
        Copy a collection of Sgroups, replacing any IAtom/IBond references with those present in the provided 'replace' map. If an empty replace map is provided (null or empty) the sgroups are simply duplicated. If an item is not present in the replacement map the original item is preserved.
        
         Map<IChemObject,IChemObject> replace = new HashMap<>();
         replace.put(orgAtom, newAtom);
         replace.put(orgBond, newBond);
         newSgroups = copy(orgSgroups, replace);
         
        Parameters:
        sgroups - collection of sgroups, can be null
        replace - the replacement map, can be null
        Returns:
        list of copied sgroups, null if sgroups input was null