public void add ( final String word , final V value ) { char c = word . charAt ( 0 ) ; LetterNode < V > node = get ( c ) ; if ( node == null ) { node = new LetterNode < V > ( this . word + c ) ; } this . nodes . put ( c , node ) ; if ( word . length ( ) == 1 ) { node . isKeyword = true ; node . value = value ; return ; } node . add ( word . substring ( 1 ) , value ) ; }
Adds a word and its related value .