@@ -0,0 +1,2305 @@
+/*%0A * Copyright 2005-2010 Roger Kapsi, Sam Berlin%0A *%0A *   Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *   you may not use this file except in compliance with the License.%0A *   You may obtain a copy of the License at%0A *%0A *       http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *   Unless required by applicable law or agreed to in writing, software%0A *   distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *   See the License for the specific language governing permissions and%0A *   limitations under the License.%0A */%0A%0Apackage org.ardverk.collection;%0A%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0A%0A/**%0A * A %7B@link Cursor%7D can be used to traverse a %7B@link Trie%7D, visit each node %0A * step by step and make %7B@link Decision%7Ds on each step how to continue with %0A * traversing the %7B@link Trie%7D.%0A */%0Apublic interface Cursor%3CK, V%3E %7B%0A    %0A    /**%0A     * The %7B@link Decision%7D tells the %7B@link Cursor%7D what to do on each step %0A     * while traversing the %7B@link Trie%7D.%0A     * %0A     * NOTE: Not all operations that work with a %7B@link Cursor%7D support all %0A     * %7B@link Decision%7D types%0A     */%0A    public static enum Decision %7B%0A        %0A        /**%0A         * Exit the traverse operation%0A         */%0A        EXIT, %0A        %0A        /**%0A         * Continue with the traverse operation%0A         */%0A        CONTINUE, %0A        %0A        /**%0A         * Remove the previously returned element%0A         * from the %7B@link Trie%7D and continue%0A         */%0A        REMOVE, %0A        %0A        /**%0A         * Remove the previously returned element%0A         * from the %7B@link Trie%7D and exit from the%0A         * traverse operation%0A         */%0A        REMOVE_AND_EXIT;%0A    %7D%0A    %0A    /**%0A     * Called for each %7B@link Entry%7D in the %7B@link Trie%7D. Return %0A     * %7B@link Decision#EXIT%7D to finish the %7B@link Trie%7D operation,%0A     * %7B@link Decision#CONTINUE%7D to go to the next %7B@link Entry%7D,%0A     * %7B@link Decision#REMOVE%7D to remove the %7B@link Entry%7D and%0A     * continue iterating or %7B@link Decision#REMOVE_AND_EXIT%7D to%0A     * remove the %7B@link Entry%7D and stop iterating.%0A     * %0A     * Note: Not all operations support %7B@link Decision#REMOVE%7D.%0A     */%0A    public Decision select(Map.Entry%3C? extends K, ? extends V%3E entry);%0A%7D

add patricia-trie's Cursor class