public static boolean stereosAreOpposite ( IAtomContainer container , IAtom atom ) { List < IAtom > atoms = container . getConnectedAtomsList ( atom ) ; TreeMap < Double , Integer > hm = new TreeMap < Double , Integer > ( ) ; for ( int i = 1 ; i < atoms . size ( ) ; i ++ ) { hm . put ( giveAngle ( atom , atoms . get ( 0 ) , atoms . get ( i ) ) , i ) ; } Object [ ] ohere = hm . values ( ) . toArray ( ) ; IBond . Stereo stereoOne = container . getBond ( atom , atoms . get ( 0 ) ) . getStereo ( ) ; IBond . Stereo stereoOpposite = container . getBond ( atom , atoms . get ( ( Integer ) ohere [ 1 ] ) ) . getStereo ( ) ; return stereoOpposite == stereoOne ; }
Says if of four atoms connected two one atom the up and down bonds are opposite or not i . e . if it s tetrehedral or square planar . The method does not check if there are four atoms and if two or up and two are down