void update ( IChemObjectBuilder bldr ) { final SmilesParser smipar = new SmilesParser ( bldr ) ; Multimap < String , Point2d [ ] > updated = LinkedListMultimap . create ( ) ; for ( Map . Entry < String , Collection < Point2d [ ] > > e : templateMap . asMap ( ) . entrySet ( ) ) { try { IAtomContainer mol = smipar . parseSmiles ( e . getKey ( ) ) ; int [ ] order = new int [ mol . getAtomCount ( ) ] ; String key = cansmi ( mol , order ) ; for ( Point2d [ ] coords : e . getValue ( ) ) { updated . put ( key , reorderCoords ( coords , order ) ) ; } } catch ( CDKException ex ) { System . err . println ( e . getKey ( ) + " could not be updated: " + ex . getMessage ( ) ) ; } } templateMap . clear ( ) ; templateMap . putAll ( updated ) ; }
Update the template library - can be called for safety after each load .