Interface Trie<K,​V>

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.SortedMap<K,​V> prefixMap​(K key)
      Returns a view of this Trie of all elements that are prefixed by the given key.
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
      • Methods inherited from interface org.apache.commons.collections4.Put

        clear, put, putAll
      • Methods inherited from interface java.util.SortedMap

        comparator, entrySet, firstKey, headMap, keySet, lastKey, subMap, tailMap, values
    • Method Detail

      • prefixMap

        java.util.SortedMap<K,​V> prefixMap​(K key)
        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