Interface Trie<K,V>

Type Parameters:
K - the type of the keys in this map
V - the type of the values in this map
All Superinterfaces:
Get<K,V>, IterableGet<K,V>, IterableMap<K,V>, IterableSortedMap<K,V>, Map<K,V>, OrderedMap<K,V>, Put<K,V>, SortedMap<K,V>
All Known Implementing Classes:
AbstractBitwiseTrie, AbstractPatriciaTrie, PatriciaTrie, UnmodifiableTrie

public interface Trie<K,V> extends IterableSortedMap<K,V>
Defines the interface for a prefix tree, an ordered tree data structure. For more information, see Tries.
Since:
4.0
  • Method Details

    • prefixMap

      Returns a view of this Trie of all elements that are prefixed by the given key.

      In a Trie with fixed size keys, this is essentially a Map.get(Object) operation.

      For example, if the Trie contains 'Anna', 'Anael', 'Analu', 'Andreas', 'Andrea', 'Andres', and 'Anatole', then a lookup of 'And' would return 'Andreas', 'Andrea', and 'Andres'.

      Parameters:
      key - the key used in the search
      Returns:
      a SortedMap view of this Trie with all elements whose key is prefixed by the search key