public static boolean isValidDoubleBondConfiguration ( IAtomContainer container , IBond bond ) { //org.openscience.cdk.interfaces.IAtom[] atoms = bond.getAtoms(); List < IAtom > connectedAtoms = container . getConnectedAtomsList ( bond . getBegin ( ) ) ; IAtom from = null ; for ( IAtom connectedAtom : connectedAtoms ) { if ( ! connectedAtom . equals ( bond . getEnd ( ) ) ) { from = connectedAtom ; } } boolean [ ] array = new boolean [ container . getBondCount ( ) ] ; for ( int i = 0 ; i < array . length ; i ++ ) { array [ i ] = true ; } if ( isStartOfDoubleBond ( container , bond . getBegin ( ) , from , array ) && isEndOfDoubleBond ( container , bond . getEnd ( ) , bond . getBegin ( ) , array ) && ! bond . getFlag ( CDKConstants . ISAROMATIC ) ) { return ( true ) ; } else { return ( false ) ; } }
Tells if a certain bond is center of a valid double bond configuration .