net.sf.eos.trie
Interface Trie.Cursor<K,V>

Type Parameters:
K - Key Type
V - Key Value
Enclosing interface:
Trie<K,V>

public static interface Trie.Cursor<K,V>

An interface used by a Trie. A Trie selects items by closeness and passes the items to the Cursor. You can then decide what to do with the key-value pair and the return value from select(java.util.Map.Entry) tells the Trie what to do next.

Cursor returns status/selection status might be:

Return ValueStatus
EXITFinish the Trie operation
CONTINUELook at the next element in the traversal
REMOVE_AND_EXITRemove the entry and stop iterating
REMOVERemove the entry and continue iterating
Note: Trie.select(Object, net.sf.eos.trie.Trie.Cursor) does not support REMOVE.


Nested Class Summary
static class Trie.Cursor.SelectStatus
          The mode during selection.
 
Method Summary
 Trie.Cursor.SelectStatus select(Map.Entry<? extends K,? extends V> entry)
          Notification that the Trie is currently looking at the given entry.
 

Method Detail

select

Trie.Cursor.SelectStatus select(Map.Entry<? extends K,? extends V> entry)
Notification that the Trie is currently looking at the given entry. Return EXIT to finish the Trie operation, CONTINUE to look at the next entry, REMOVE to remove the entry and continue iterating, or REMOVE_AND_EXIT to remove the entry and stop iterating. Not all operations support REMOVE.



Copyright © 2008. All Rights Reserved.