public boolean saturateByIncreasingBondOrder ( IBond bond , IAtomContainer atomContainer ) throws CDKException { IAtom [ ] atoms = BondManipulator . getAtomArray ( bond ) ; IAtom atom = atoms [ 0 ] ; IAtom partner = atoms [ 1 ] ; logger . debug ( " saturating bond: " , atom . getSymbol ( ) , "-" , partner . getSymbol ( ) ) ; IAtomType [ ] atomTypes1 = getAtomTypeFactory ( bond . getBuilder ( ) ) . getAtomTypes ( atom . getSymbol ( ) ) ; IAtomType [ ] atomTypes2 = getAtomTypeFactory ( bond . getBuilder ( ) ) . getAtomTypes ( partner . getSymbol ( ) ) ; for ( int atCounter1 = 0 ; atCounter1 < atomTypes1 . length ; atCounter1 ++ ) { IAtomType aType1 = atomTypes1 [ atCounter1 ] ; logger . debug ( " condidering atom type: " , aType1 ) ; if ( couldMatchAtomType ( atomContainer , atom , aType1 ) ) { logger . debug ( " trying atom type: " , aType1 ) ; for ( int atCounter2 = 0 ; atCounter2 < atomTypes2 . length ; atCounter2 ++ ) { IAtomType aType2 = atomTypes2 [ atCounter2 ] ; logger . debug ( " condidering partner type: " , aType1 ) ; if ( couldMatchAtomType ( atomContainer , partner , atomTypes2 [ atCounter2 ] ) ) { logger . debug ( " with atom type: " , aType2 ) ; if ( BondManipulator . isLowerOrder ( bond . getOrder ( ) , aType2 . getMaxBondOrder ( ) ) && BondManipulator . isLowerOrder ( bond . getOrder ( ) , aType1 . getMaxBondOrder ( ) ) ) { bond . setOrder ( BondManipulator . increaseBondOrder ( bond . getOrder ( ) ) ) ; logger . debug ( "Bond order now " , bond . getOrder ( ) ) ; return true ; } } } } } return false ; }
Tries to saturate a bond by increasing its bond orders by 1 . 0 .