Skip to content

Commit

Permalink
Added removal of stereo elements in 'removeAllElements()' - documenta…
Browse files Browse the repository at this point in the history
…tion has been updated

Change-Id: I02bd4d114e918c5aaabd881546c29afae55d6800
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Nov 2, 2012
1 parent f8f98fe commit d1e8fa6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/org/openscience/cdk/AtomContainer.java
Expand Up @@ -1329,15 +1329,17 @@ public void removeAtomAndConnectedElectronContainers(IAtom atom)
}

/**
* Removes all atoms and bond from this container.
* @inheritDoc
*/
@Override
public void removeAllElements() {
removeAllElectronContainers();
for (int f = 0; f < getAtomCount(); f++) {
getAtom(f).removeListener(this);
}
atoms = new IAtom[growArraySize];
atomCount = 0;
stereoElements.clear();
notifyChanged();
}

Expand Down
Expand Up @@ -538,7 +538,7 @@ public interface IAtomContainer extends IChemObject, IChemObjectListener {
public void removeAtomAndConnectedElectronContainers(IAtom atom);

/**
* Removes all atoms and bond from this container.
* Removes all atoms, bonds and stereo elements from this container.
*/
public void removeAllElements();

Expand Down
4 changes: 3 additions & 1 deletion src/main/org/openscience/cdk/silent/AtomContainer.java
Expand Up @@ -1293,12 +1293,14 @@ public void removeAtomAndConnectedElectronContainers(IAtom atom)
}

/**
* Removes all atoms and bond from this container.
* @inheritDoc
*/
@Override
public void removeAllElements() {
removeAllElectronContainers();
atoms = new IAtom[growArraySize];
atomCount = 0;
stereoElements.clear();
}


Expand Down

0 comments on commit d1e8fa6

Please sign in to comment.