/** * Adds a Bond to this AtomContainer. * *@param bond The bond to added to this container */ @Override public void addBond(IBond bond) { if (bondCount >= bonds.length) growBondArray(); bonds[bondCount] = bond; ++bondCount; notifyChanged(); }
/** * Adds a bond to this container. * *@param atom1 Id of the first atom of the Bond in [0,..] *@param atom2 Id of the second atom of the Bond in [0,..] *@param order Bondorder */ @Override public void addBond(int atom1, int atom2, IBond.Order order) { IBond bond = getBuilder().newInstance(IBond.class, getAtom(atom1), getAtom(atom2), order); if (bondCount >= bonds.length) { growBondArray(); } addBond(bond); /* * no notifyChanged() here because addBond(bond) does it already */ }
/** * Adds a bond to this container. * *@param atom1 Id of the first atom of the Bond in [0,..] *@param atom2 Id of the second atom of the Bond in [0,..] *@param order Bondorder *@param stereo Stereochemical orientation */ @Override public void addBond(int atom1, int atom2, IBond.Order order, IBond.Stereo stereo) { IBond bond = getBuilder().newInstance(IBond.class, getAtom(atom1), getAtom(atom2), order, stereo); if (contains(bond)) { return; } if (bondCount >= bonds.length) { growBondArray(); } addBond(bond); /* * no notifyChanged() here because addBond(bond) does it already */ }