public void put ( String id , StringWrapper toInsert , Object value ) { MyWrapper wrapper = asMyWrapper ( toInsert ) ; Token [ ] tokens = wrapper . getTokens ( ) ; for ( int i = 0 ; i < tokens . length ; i ++ ) { ArrayList stringsWithToken = ( ArrayList ) index . get ( tokens [ i ] ) ; if ( stringsWithToken == null ) index . put ( tokens [ i ] , ( stringsWithToken = new ArrayList ( ) ) ) ; stringsWithToken . add ( wrapper ) ; } map . put ( wrapper , value ) ; if ( id != null ) idMap . put ( wrapper , id ) ; distance = null ; // mark distance as "out of date" totalEntries ++ ; }
Insert a prepared string into the dictionary .