@ Override public IRingSet getConnectedRings ( IRing ring ) { IRingSet connectedRings = ring . getBuilder ( ) . newInstance ( IRingSet . class ) ; IRing tempRing ; IAtom atom ; for ( int i = 0 ; i < ring . getAtomCount ( ) ; i ++ ) { atom = ring . getAtom ( i ) ; for ( int j = 0 ; j < getAtomContainerCount ( ) ; j ++ ) { tempRing = ( IRing ) getAtomContainer ( j ) ; if ( tempRing != ring && ! connectedRings . contains ( tempRing ) && tempRing . contains ( atom ) ) { connectedRings . addAtomContainer ( tempRing ) ; } } } return connectedRings ; }
Returns all the rings in the RingSet that share one or more atoms with a given ring .