/** * Adds a LonePair to this Atom. * *@param atomID The atom number to which the LonePair is added in [0,..] */ @Override public void addSingleElectron(int atomID) { ISingleElectron singleElectron = getBuilder().newInstance(ISingleElectron.class, atoms[atomID]); singleElectron.addListener(this); addSingleElectron(singleElectron); /* * no notifyChanged() here because addSingleElectron() does it already */ }
/** * Adds a LonePair to this Atom. * *@param atomID The atom number to which the LonePair is added in [0,..] */ @Override public void addLonePair(int atomID) { ILonePair lonePair = getBuilder().newInstance(ILonePair.class, atoms[atomID]); lonePair.addListener(this); addLonePair(lonePair); /* * no notifyChanged() here because addElectronContainer() 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 */ @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 */ }