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 ; }
Looking if the Bond belongs to the bond family . Not in resosance with other heteroatoms .