/** * True, if the AtomContainer contains the given LonePair object. * *@param lonePair the LonePair this AtomContainer is searched for *@return true if the AtomContainer contains the given LonePair object */ @Override public boolean contains(ILonePair lonePair) { for (int i = 0; i < getLonePairCount(); i++) { if (lonePair == lonePairs[i]) return true; } return false; }
@Override public String toString() { StringBuilder s = new StringBuilder(); s.append("QueryAtomContainer("); s.append(this.hashCode()); s.append(", #A:").append(getAtomCount()); s.append(", #EC:").append(getElectronContainerCount()); for (int i = 0; i < getAtomCount(); i++) { s.append(", ").append(getAtom(i).toString()); } for (int i = 0; i < getBondCount(); i++) { s.append(", ").append(getBond(i).toString()); } for (int i = 0; i < getLonePairCount(); i++) { s.append(", ").append(getLonePair(i).toString()); } for (int i = 0; i < getSingleElectronCount(); i++) { s.append(", ").append(getSingleElectron(i).toString()); } s.append(')'); return s.toString(); }
/** * Removes electronContainers from this container. */ @Override public void removeAllElectronContainers() { removeAllBonds(); for (int f = 0; f < getLonePairCount(); f++) { getLonePair(f).removeListener(this); } for (int f = 0; f < getSingleElectronCount(); f++) { getSingleElectron(f).removeListener(this); } lonePairs = new ILonePair[growArraySize]; singleElectrons = new ISingleElectron[growArraySize]; lonePairCount = 0; singleElectronCount = 0; notifyChanged(); }
for (int i = 0; i < getLonePairCount(); ++i) { lp = getLonePair(i); newLp = (ILonePair) lp.clone();