@Override public void remove() { removeAtomOnly(--pointer); }
/** * Removes the given atom from the AtomContainer. Note that the * electronContainers are unaffected: you also have to take care of removing * all electronContainers to this atom from the container. * *@param atom The atom to be removed */ @Override public void removeAtomOnly(IAtom atom) { int position = getAtomNumber(atom); if (position != -1) { removeAtomOnly(position); } }
removeAtomOnly(position);
/** * 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)); } }