Adds a Bond to this AtomContainer.

@param  bond  The bond to added to this container
330726
@Override
    public void addBond(IBond bond) {
        if (bondCount >= bonds.length) growBondArray();
        bonds[bondCount] = bond;
        ++bondCount;
        notifyChanged();
    }
104175
def add_bond(self, atom1, atom2, bond):
        
        if atom1 == atom2:
            raise KeyError('atom loops impossible')
        if atom1 not in self._node or atom2 not in self._node:
            raise KeyError('atoms not found')
        if atom1 in self._adj[atom2]:
            raise KeyError('atoms already bonded')

        attr_dict = self.edge_attr_dict_factory()
        if isinstance(bond, int):
            attr_dict.order = bond
        else:
            attr_dict.update(bond)

        self._adj[atom1][atom2] = self._adj[atom2][atom1] = attr_dict
        self.flush_cache()
1004714
@Override
    public void addAtomContainer(IAtomContainer atomContainer, double multiplier) {
        if (atomContainerCount + 1 >= atomContainers.length) {
            growAtomContainerArray();
        }
        atomContainer.addListener(this);
        atomContainers[atomContainerCount] = atomContainer;
        multipliers[atomContainerCount] = multiplier;
        atomContainerCount++;
        notifyChanged();
    }
644667
@Override
    public void setBonds(IBond[] bonds) {
        this.bonds = bonds;
        for (IBond bond : bonds) {
            bond.addListener(this);
        }
        this.bondCount = bonds.length;
    }
966260
@Override
    public void add(IMolecularFormulaSet formulaSet) {

        for (IMolecularFormula mf : formulaSet.molecularFormulas()) {
            addMolecularFormula(mf);
        }
    }
514397
synchronized void add(final Container container) {
    final String containerId = container.getId().toString();
    if (this.hasContainer(containerId)) {
      throw new RuntimeException("Trying to add a Container that is already known: " + containerId);
    }
    this.containers.put(containerId, container);
  }
949296
@Override
    public void saturate(IAtomContainer atomContainer) throws CDKException {
        logger.info("Saturating atomContainer by adjusting bond orders...");
        boolean allSaturated = allSaturated(atomContainer);
        if (!allSaturated) {
            logger.info("Saturating bond orders is needed...");
            IBond[] bonds = new IBond[atomContainer.getBondCount()];
            for (int i = 0; i < bonds.length; i++)
                bonds[i] = atomContainer.getBond(i);
            boolean succeeded = saturate(bonds, atomContainer);
            if (!succeeded) {
                throw new CDKException("Could not saturate this atomContainer!");
            }
        }
    }
527765
private static boolean familyBond(IAtomContainer container, IBond bond) {
        List<String> normalAt = new ArrayList<String>();
        normalAt.add("C");
        normalAt.add("H");

        if (getDoubleBondNumber(container) > 30) // taking to long
            return false;

        StructureResonanceGenerator gRN = new StructureResonanceGenerator();
        IAtomContainer ac = gRN.getContainer(container, bond);

        if (ac == null) return true;

        if (getDoubleBondNumber(ac) > 15) // taking to long
            return false;

        for (IAtom atom : container.atoms()) {
            if (!normalAt.contains(atom.getSymbol())) if (ac.contains(atom)) return false;
        }

        return true;
    }
31523
public void addImplicitHydrogens(IAtomContainer container) throws CDKException {
        for (IAtom atom : container.atoms()) {
            if (!(atom instanceof IPseudoAtom)) {
                addImplicitHydrogens(container, atom);
            }
        }
    }
287933
@Override
    public void add(IAtomContainerSet atomContainerSet) {
        for (IAtomContainer iter : atomContainerSet.atomContainers()) {
            addAtomContainer(iter);
        }
        /*
         * notifyChanged() is called by addAtomContainer()
         */
    }
841905
private void initPath(IAtomContainer molecule) {
        for (int i = 0; i < molecule.getAtomCount(); i++) {
            IAtom atom = molecule.getAtom(i);
            atom.setProperty(PATH, new ArrayList<IAtom>());
        }
    }
577394
@Override
    public void addAtom(IAtom oAtom, IMonomer oMonomer) {

        if (!contains(oAtom)) {
            super.addAtom(oAtom);

            if (oMonomer != null) { // Not sure what's better here...throw nullpointer exception?
                oMonomer.addAtom(oAtom);
                if (!monomers.containsKey(oMonomer.getMonomerName())) {
                    monomers.put(oMonomer.getMonomerName(), oMonomer);
                }
            }
        }
        /*
         * notifyChanged() is called by addAtom in AtomContainer
         */
    }
133222
@Override
    public void addAtom(IAtom oAtom, IStrand oStrand) {

        int atomCount = super.getAtomCount();

        // Add atom to AtomContainer
        super.addAtom(oAtom);

        if (atomCount != super.getAtomCount() && oStrand != null) { // Maybe better to throw null pointer exception here, so user realises that
                                                                    // Strand == null and Atom only gets added to this BioPolymer, but not to a Strand.
            oStrand.addAtom(oAtom);
            if (!strands.containsKey(oStrand.getStrandName())) {
                strands.put(oStrand.getStrandName(), oStrand);
            }
        }
        /*
         * notifyChanged() is called by addAtom in AtomContainer
         */
    }
258605
private void addSelfToAtoms() {
		List<Bond> bonds = atomA.getBonds();
		if (bonds==null) {
			bonds = new ArrayList<Bond>(AtomImpl.BONDS_INITIAL_CAPACITY);
			atomA.setBonds(bonds);
		}

		boolean exists = false;
		for (Bond bond : bonds) {
			// TODO is it equals() what we want here, or is it == ? - JD 2016-03-02
			if (bond.getOther(atomA).equals(atomB)) {
				exists = true;
				break;
			}
		}
		if (!exists) {
			atomA.addBond(this);
			atomB.addBond(this);
		}
	}
755476
@Override
    public void removeAtom(IAtom atom) {
        int position = getAtomNumber(atom);
        if (position != -1) {
            for (int i = 0; i < bondCount; i++) {
                if (bonds[i].contains(atom)) {
                    removeBond(i);
                    --i;
                }
            }
            for (int i = 0; i < lonePairCount; i++) {
                if (lonePairs[i].contains(atom)) {
                    removeLonePair(i);
                    --i;
                }
            }
            for (int i = 0; i < singleElectronCount; i++) {
                if (singleElectrons[i].contains(atom)) {
                    removeSingleElectron(i);
                    --i;
                }
            }
            removeAtomOnly(position);
        }
        notifyChanged();
    }
1179936
public double calculateBondPolarizability(IAtomContainer atomContainer, IBond bond) {
        double polarizabilitiy = 0;
        IAtomContainer acH = atomContainer.getBuilder().newInstance(IAtomContainer.class, atomContainer);
        addExplicitHydrogens(acH);
        if (bond.getAtomCount() == 2) {
            polarizabilitiy += getKJPolarizabilityFactor(acH, bond.getBegin());
            polarizabilitiy += getKJPolarizabilityFactor(acH, bond.getEnd());
        }
        return (polarizabilitiy / 2);
    }
344614
public IAtomContainer getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac) {

        List bonds = ac.getConnectedBondsList(atom);
        IAtomContainer connectedAtoms = atom.getBuilder().newInstance(IAtomContainer.class);
        IAtom connectedAtom = null;
        for (int i = 0; i < bonds.size(); i++) {
            connectedAtom = ((IBond) bonds.get(i)).getOther(atom);
            if (connectedAtom.getFlag(CDKConstants.ISPLACED)) {
                connectedAtoms.addAtom(connectedAtom);
            }
        }
        return connectedAtoms;
    }