private void setActiveCenters ( IAtomContainer reactant ) throws CDKException { if ( AtomContainerManipulator . getTotalCharge ( reactant ) != 0 ) return ; Iterator < IBond > bondis = reactant . bonds ( ) . iterator ( ) ; while ( bondis . hasNext ( ) ) { IBond bondi = bondis . next ( ) ; if ( ( ( bondi . getOrder ( ) == IBond . Order . DOUBLE ) || ( bondi . getOrder ( ) == IBond . Order . TRIPLE ) ) ) { int chargeAtom0 = bondi . getBegin ( ) . getFormalCharge ( ) == null ? 0 : bondi . getBegin ( ) . getFormalCharge ( ) ; int chargeAtom1 = bondi . getEnd ( ) . getFormalCharge ( ) == null ? 0 : bondi . getEnd ( ) . getFormalCharge ( ) ; if ( chargeAtom0 >= 0 && chargeAtom1 >= 0 && reactant . getConnectedSingleElectronsCount ( bondi . getBegin ( ) ) == 0 && reactant . getConnectedSingleElectronsCount ( bondi . getEnd ( ) ) == 0 && reactant . getConnectedLonePairsCount ( bondi . getBegin ( ) ) == 0 && reactant . getConnectedLonePairsCount ( bondi . getEnd ( ) ) == 0 ) { bondi . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; bondi . getBegin ( ) . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; bondi . getEnd ( ) . setFlag ( CDKConstants . REACTIVE_CENTER , true ) ; } } } }
set the active center for this molecule . The active center will be those which correspond with X = Y .