public final class SgroupManipulator extends Object
Modifier and Type | Method and Description |
---|---|
static List<Sgroup> |
copy(Collection<Sgroup> sgroups,
Map<? extends IChemObject,? extends IChemObject> replace)
|
public static List<Sgroup> copy(Collection<Sgroup> sgroups, Map<? extends IChemObject,? extends IChemObject> replace)
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);
sgroups
- collection of sgroups, can be nullreplace
- the replacement map, can be nullCopyright © 2021. All rights reserved.