private void addToTail(Trie.Node node) {
        while (true) {
            if (tailBuffer.capacity() < tailIndex - TAIL_OFFSET + 1) {
                CharBuffer newTailBuffer = CharBuffer.allocate(
                                tailBuffer.capacity() + (int) (tailBuffer.capacity() * BUFFER_GROWTH_PERCENTAGE));
                tailBuffer.rewind();
                newTailBuffer.put(tailBuffer);
                tailBuffer = newTailBuffer;
            }
            tailBuffer.put(tailIndex++ - TAIL_OFFSET, node.getKey());// set character of current node

            if (node.getChildren().isEmpty()) { // if it reached the end of input, break.
                break;
            }
            node = node.getChildren().get(0); // Move to next node
        }
    }
private void addToTail ( Trie . Node node ) { while ( true ) { if ( tailBuffer . capacity ( ) < tailIndex - TAIL_OFFSET + 1 ) { CharBuffer newTailBuffer = CharBuffer . allocate ( tailBuffer . capacity ( ) + ( int ) ( tailBuffer . capacity ( ) * BUFFER_GROWTH_PERCENTAGE ) ) ; tailBuffer . rewind ( ) ; newTailBuffer . put ( tailBuffer ) ; tailBuffer = newTailBuffer ; } tailBuffer . put ( tailIndex ++ - TAIL_OFFSET , node . getKey ( ) ) ; if ( node . getChildren ( ) . isEmpty ( ) ) { break ; } node = node . getChildren ( ) . get ( 0 ) ; } }
Add characters(nodes) to tail array

@param node