@Override public void remove() { removeSingleElectron(--pointer); }
/** * Removes the single electron from the AtomContainer. * *@param singleElectron The SingleElectron to be removed. */ @Override public void removeSingleElectron(ISingleElectron singleElectron) { int pos = indexOf(singleElectron); if (pos != -1) removeSingleElectron(pos); }
@Override public void remove() { if (pointer <= bondCount) removeBond(--pointer); else if (pointer <= bondCount + lonePairCount) removeLonePair((--pointer) - bondCount); else if (pointer <= bondCount + lonePairCount + singleElectronCount) removeSingleElectron((--pointer) - bondCount - lonePairCount); }
/** * Removes this ElectronContainer from this container. * * @param electronContainer The electronContainer to be removed */ @Override public void removeElectronContainer(IElectronContainer electronContainer) { if (electronContainer instanceof IBond) removeBond((IBond) electronContainer); else if (electronContainer instanceof ILonePair) removeLonePair((ILonePair) electronContainer); else if (electronContainer instanceof ISingleElectron) removeSingleElectron((ISingleElectron) electronContainer); }
/** * Removes the bond at the given position from this container. * * @param number The position of the bond in the electronContainers array * @return Bond that was removed */ @Override public IElectronContainer removeElectronContainer(int number) { if (number < this.bondCount) return removeBond(number); number -= this.bondCount; if (number < this.lonePairCount) return removeLonePair(number); number -= this.lonePairCount; if (number < this.singleElectronCount) return removeSingleElectron(number); return null; }
removeSingleElectron(i); --i;
/** * Removes all atoms and electronContainers of a given atomcontainer from this * container. * *@param atomContainer The atomcontainer to be removed */ @Override public void remove(IAtomContainer atomContainer) { for (int f = 0; f < atomContainer.getAtomCount(); f++) { removeAtomOnly(atomContainer.getAtom(f)); } for (int f = 0; f < atomContainer.getBondCount(); f++) { removeBond(atomContainer.getBond(f)); } for (int f = 0; f < atomContainer.getLonePairCount(); f++) { removeLonePair(atomContainer.getLonePair(f)); } for (int f = 0; f < atomContainer.getSingleElectronCount(); f++) { removeSingleElectron(atomContainer.getSingleElectron(f)); } }