/** * {@inheritDoc} */ @Override public IBond removeBond(int idx) { BondRef bond = null; if (idx >= 0 && idx < numBonds) { bond = bonds[idx]; numBonds--; for (int i = idx; i < numBonds; i++) { bonds[i] = bonds[i + 1]; bonds[i].setIndex(i); } delFromEndpoints(bond); bonds[numBonds] = null; bond.removeListener(this); notifyChanged(); } return bond; }
/** * {@inheritDoc} */ @Override public IBond removeBond(int idx) { BondRef bond = null; if (idx >= 0 && idx < numBonds) { bond = bonds[idx]; numBonds--; for (int i = idx; i < numBonds; i++) { bonds[i] = bonds[i + 1]; bonds[i].setIndex(i); } delFromEndpoints(bond); bonds[numBonds] = null; bond.removeListener(this); notifyChanged(); } return bond; }