private static void makeElevationMap ( IAtom atom , List < IBond > bonds , Map < IAtom , Integer > map ) { map . clear ( ) ; for ( IBond bond : bonds ) { int elevation = 0 ; switch ( bond . getStereo ( ) ) { case UP : case DOWN_INVERTED : elevation = + 1 ; break ; case DOWN : case UP_INVERTED : elevation = - 1 ; break ; } // change elevation depending on which end of the wedge/hatch // the atom is on if ( bond . getBegin ( ) . equals ( atom ) ) { map . put ( bond . getEnd ( ) , elevation ) ; } else { map . put ( bond . getBegin ( ) , - 1 * elevation ) ; } } }
Maps the input bonds to a map of Atom - > Elevation where the elevation is whether the bond is off the plane with respect to the central atom .