Logo Search packages:      
Sourcecode: cdk version File versions  Download package

static IAtom [] org::openscience::cdk::graph::PathTools::findClosestByBond ( IAtomContainer  atomContainer,
IAtom  atom,
int  max 
) [inline, static]

Returns the atoms which are closest to an atom in an AtomContainer by bonds. If number of atoms in or below sphere x<max and number of atoms in or below sphere x+1>max then atoms in or below sphere x+1 are returned.

atomContainerThe AtomContainer to examine
atomthe atom to start from
maxthe number of neighbours to return
the average bond length

Definition at line 222 of file PathTools.java.

References org::openscience::cdk::interfaces::IAtomContainer::add(), org::openscience::cdk::interfaces::IAtomContainer::getAtom(), org::openscience::cdk::interfaces::IAtomContainer::getAtomCount(), org::openscience::cdk::interfaces::IChemObject::getBuilder(), and org::openscience::cdk::interfaces::IChemObjectBuilder::newMolecule().

        IMolecule mol = atomContainer.getBuilder().newMolecule();
        List<IAtom> v = new ArrayList<IAtom>();
        breadthFirstSearch(atomContainer, v, mol, max);
        IAtom[] returnValue = new IAtom[mol.getAtomCount() - 1];
        int k = 0;
        for (int i = 0; i < mol.getAtomCount(); i++) {
            if (mol.getAtom(i) != atom) {
                returnValue[k] = mol.getAtom(i);
        return (returnValue);

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index