/** * {@inheritDoc} */ @Override public void addElectronContainer(IElectronContainer ec) { if (ec instanceof IBond) this.addBond((IBond) ec); if (ec instanceof ILonePair) this.addLonePair((ILonePair) ec); if (ec instanceof ISingleElectron) this.addSingleElectron((ISingleElectron) ec); notifyChanged(); }
/** * {@inheritDoc} */ @Override public void addElectronContainer(IElectronContainer ec) { if (ec instanceof IBond) this.addBond((IBond) ec); if (ec instanceof ILonePair) this.addLonePair((ILonePair) ec); if (ec instanceof ISingleElectron) this.addSingleElectron((ISingleElectron) ec); notifyChanged(); }
/** * {@inheritDoc} */ @Override public void addSingleElectron(int idx) { ISingleElectron electron = getBuilder().newInstance(ISingleElectron.class); electron.setAtom(getAtom(idx)); addSingleElectron(electron); }
/** * {@inheritDoc} */ @Override public void addSingleElectron(int idx) { ISingleElectron electron = getBuilder().newInstance(ISingleElectron.class); electron.setAtom(getAtom(idx)); addSingleElectron(electron); }
electron.setAtom(atomMap.get(original.getAtom())); clone.addSingleElectron(electron);
electron.setAtom(atomMap.get(original.getAtom())); clone.addSingleElectron(electron);
/** * Constructs a shallow copy of the provided IAtomContainer with the same * atoms, bonds, electron containers and stereochemistry of another * AtomContainer. Removing atoms/bonds in this copy will not affect * the original, however changing the properties will. * * @param src the source atom container */ AtomContainer2(IAtomContainer src) { this(src.getAtomCount(), src.getBondCount(), src.getLonePairCount(), src.getSingleElectronCount()); for (IAtom atom : src.atoms()) addAtom(atom); for (IBond bond : src.bonds()) addBond(bond); for (ISingleElectron se : src.singleElectrons()) addSingleElectron(se); for (ILonePair lp : src.lonePairs()) addLonePair(lp); for (IStereoElement se : src.stereoElements()) addStereoElement(se); }
/** * Constructs a shallow copy of the provided IAtomContainer with the same * atoms, bonds, electron containers and stereochemistry of another * AtomContainer. Removing atoms/bonds in this copy will not affect * the original, however changing the properties will. * * @param src the source atom container */ AtomContainer2(IAtomContainer src) { this(src.getAtomCount(), src.getBondCount(), src.getLonePairCount(), src.getSingleElectronCount()); for (IAtom atom : src.atoms()) addAtom(atom); for (IBond bond : src.bonds()) addBond(bond); for (ISingleElectron se : src.singleElectrons()) addSingleElectron(se); for (ILonePair lp : src.lonePairs()) addLonePair(lp); for (IStereoElement se : src.stereoElements()) addStereoElement(se); }