@Override public void remove() { removeBond(--pointer); }
/** * Removes the bond from this container. * * @param bond The bond to be removed. */ @Override public void removeBond(IBond bond) { int pos = getBondNumber(bond); if (pos != -1) removeBond(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; }
/** * Removes the bond that connects the two given atoms. * * @param atom1 The first atom * @param atom2 The second atom * @return The bond that connects the two atoms */ @Override public IBond removeBond(IAtom atom1, IAtom atom2) { int pos = indexOf(getBond(atom1, atom2)); IBond bond = null; if (pos != -1) { bond = bonds[pos]; removeBond(pos); } return bond; }
for (int i = 0; i < bondCount; i++) { if (bonds[i].contains(atom)) { removeBond(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)); } }
|| (bondAtom0.getSymbol().equals("N") && bondAtom1.getSymbol().equals("C")) && bond.getOrder() == IBond.Order.SINGLE) { aminoAcid.removeBond(bondAtom0, bondAtom1); QueryBond qbond = new QueryBond(bondAtom0, bondAtom1, Expr.Type.SINGLE_OR_AROMATIC); aminoAcid.addBond(qbond);
|| (bondAtom0.getSymbol().equals("N") && bondAtom1.getSymbol().equals("C")) && bond.getOrder() == IBond.Order.SINGLE) { aminoAcid.removeBond(bondAtom0, bondAtom1); QueryBond qbond = new QueryBond(bondAtom0, bondAtom1, Expr.Type.SINGLE_OR_AROMATIC); aminoAcid.addBond(qbond);