private void insertNode ( PatriciaNode < V > node ) { PatriciaNode < V > current = root . getLeft ( ) ; PatriciaNode < V > parent = root ; while ( parent . getBit ( ) < current . getBit ( ) && current . getBit ( ) < node . getBit ( ) ) { parent = current ; if ( ! keyMapper . isSet ( current . getBit ( ) , node . getKey ( ) ) ) { current = current . getLeft ( ) ; } else { current = current . getRight ( ) ; } } if ( ! keyMapper . isSet ( node . getBit ( ) , node . getKey ( ) ) ) { node . setLeft ( node ) ; node . setRight ( current ) ; } else { node . setLeft ( current ) ; node . setRight ( node ) ; } if ( ! keyMapper . isSet ( parent . getBit ( ) , node . getKey ( ) ) ) { parent . setLeft ( node ) ; } else { parent . setRight ( node ) ; } }
Inserts a node into this trie