@Deprecated
    protected final void buildImpl(Option buildOption) {
        switch(state) {
        case ADDING:
            if(root==null) {
                throw new IndexOutOfBoundsException("No (string, value) pairs were added.");
            }
            if(buildOption==Option.FAST) {
                state=State.BUILDING_FAST;
                // Building "fast" is somewhat faster (25..50% in some test)
                // because it makes registerNode() return the input node
                // rather than checking for duplicates.
                // As a result, we sometimes write larger trie serializations.
                //
                // In either case we need to fix-up linear-match nodes (for their maximum length)
                // and branch nodes (turning dynamic branch nodes into trees of
                // runtime-equivalent nodes), but the HashMap/hashCode()/equals() are omitted for
                // nodes other than final values.
            } else {
                state=State.BUILDING_SMALL;
            }
            break;
        case BUILDING_FAST:
        case BUILDING_SMALL:
            // Building must have failed.
            throw new IllegalStateException("Builder failed and must be clear()ed.");
        case BUILT:
            return;  // Nothing more to do.
        }
        // Implementation note:
        // We really build three versions of the trie.
        // The first is a fully dynamic trie, built successively by addImpl().
        // Then we call root.register() to turn it into a tree of nodes
        // which is 1:1 equivalent to the runtime data structure.
        // Finally, root.markRightEdgesFirst() and root.write() write that serialized form.
        root=root.register(this);
        root.markRightEdgesFirst(-1);
        root.write(this);
        state=State.BUILT;
    }
@ Deprecated protected final void buildImpl ( Option buildOption ) { switch ( state ) { case ADDING : if ( root == null ) { throw new IndexOutOfBoundsException ( "No (string, value) pairs were added." ) ; } if ( buildOption == Option . FAST ) { state = State . BUILDING_FAST ; } else { state = State . BUILDING_SMALL ; } break ; case BUILDING_FAST : case BUILDING_SMALL : throw new IllegalStateException ( "Builder failed and must be clear()ed." ) ; case BUILT : return ; } root = root . register ( this ) ; root . markRightEdgesFirst ( - 1 ) ; root . write ( this ) ; state = State . BUILT ; }
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android