Package org.apache.commons.collections4
Interface Trie<K,V>
- 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,PatriciaTrie,UnmodifiableTrie
Defines the interface for a prefix tree, an ordered tree data structure. For
more information, see Tries.
- Since:
- 4.0
- Version:
- $Id: Trie.java 1543279 2013-11-19 00:54:31Z ggregory $
-
Nested Class Summary
-
Method Summary
Methods inherited from interface org.apache.commons.collections4.Get
containsKey, containsValue, entrySet, get, isEmpty, keySet, remove, size, valuesMethods 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, sizeMethods inherited from interface org.apache.commons.collections4.OrderedMap
firstKey, lastKey, mapIterator, nextKey, previousKey
-
Method Details
-
prefixMap
Returns a view of thisTrieof all elements that are prefixed by the given key.In a
Triewith fixed size keys, this is essentially aMap.get(Object)operation.For example, if the
Triecontains 'Anna', 'Anael', 'Analu', 'Andreas', 'Andrea', 'Andres', and 'Anatole', then a lookup of 'And' would return 'Andreas', 'Andrea', and 'Andres'.
-