public interface NavigableCompositeTrie<K,C,V> extends CompositeTrie<K,C,V>, NavigableMap<K,V>
Modifier and Type | Method and Description |
---|---|
Comparator<? super C> |
componentComparator() |
NavigableCompositeTrie<K,C,V> |
descendingMap() |
NavigableCompositeTrie<K,C,V> |
headMap(K toKey) |
NavigableCompositeTrie<K,C,V> |
headMap(K toKey,
boolean inclusive) |
NavigableCompositeTrie<K,C,V> |
prefixMap(C prefix)
Generates a view of all mappings whose keys have the specified prefix.
|
NavigableCompositeTrie<K,C,V> |
prefixMap(Iterable<C> prefix)
Generates a view of all mappings whose keys have the specified prefix.
|
NavigableCompositeTrie<K,C,V> |
prefixMap(Iterable<C> prefix,
int numComponents)
Generates a view of all mappings whose keys have the specified prefix.
|
NavigableCompositeTrie<K,C,V> |
prefixMapByKey(K prefix)
Generates a view of all mappings whose keys have the specified prefix.
|
NavigableCompositeTrie<K,C,V> |
prefixMapByKey(K prefix,
int numComponents)
Generates a view of all mappings whose keys have the specified prefix.
|
NavigableCompositeTrie<K,C,V> |
subMap(K fromKey,
boolean fromInclusive,
K toKey,
boolean toInclusive) |
NavigableCompositeTrie<K,C,V> |
subMap(K fromKey,
K toKey) |
NavigableCompositeTrie<K,C,V> |
tailMap(K fromKey) |
NavigableCompositeTrie<K,C,V> |
tailMap(K fromKey,
boolean inclusive) |
componentizer
ceilingEntry, ceilingKey, descendingKeySet, firstEntry, floorEntry, floorKey, higherEntry, higherKey, lastEntry, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry
comparator, entrySet, firstKey, keySet, lastKey, values
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
Comparator<? super C> componentComparator()
NavigableCompositeTrie<K,C,V> prefixMapByKey(K prefix)
CompositeTrie
This is equivalent to the following:
trie.prefixMap(componentizer().getComponents(prefix));
prefixMapByKey
in interface CompositeTrie<K,C,V>
prefix
- a key prefixCompositeTrie.prefixMap(Iterable)
NavigableCompositeTrie<K,C,V> prefixMapByKey(K prefix, int numComponents)
CompositeTrie
This is equivalent to the following:
trie.prefixMap(componentizer().getComponents(prefix), numComponents);
prefixMapByKey
in interface CompositeTrie<K,C,V>
prefix
- a key prefixnumComponents
- the maximum number of components of the prefixCompositeTrie.prefixMap(Iterable, int)
NavigableCompositeTrie<K,C,V> prefixMap(C prefix)
CompositeTrie
IllegalArgumentException
s.
For example, suppose we have a trie that uses strings as keys. The strings are broken into character components. The trie has the following mappings:
{ "abcd" } -> 123, { "abxyz" } -> 456, { "efgh" } -> 789The prefix map, with a prefix of
'a'
, would look like so:
{ "abcd" } -> 123, { "abxyz" } -> 456,If the mapping { "mno" } -> 1001 were added to the prefix map, an
IllegalArgumentException
would be thrown since it does not begin with the correct
prefix. But adding { "amno" } -> 1001 would succeed, and the resulting prefix map
would then look like the following:
{ "abcd" } -> 123, { "abxyz" } -> 456, { "amno" } -> 1001The new mapping would also be present in the main, underlying map:
{ "abcd" } -> 123, { "abxyz" } -> 456, { "amno" } -> 1001, { "efgh" } -> 789
prefixMap
in interface CompositeTrie<K,C,V>
prefix
- a key prefixNavigableCompositeTrie<K,C,V> prefixMap(Iterable<C> prefix)
CompositeTrie
This is effectively shorthand for repeated calls to CompositeTrie.prefixMap(Object)
, like so:
CompositeTrie<K, C, V> result = someTrie; for (C component : prefix) { result = result.prefixMap(component); }
prefixMap
in interface CompositeTrie<K,C,V>
prefix
- a key prefixCompositeTrie.prefixMap(Object)
NavigableCompositeTrie<K,C,V> prefixMap(Iterable<C> prefix, int numComponents)
CompositeTrie
prefixMap
in interface CompositeTrie<K,C,V>
prefix
- a key prefixnumComponents
- the maximum number of components of the prefixCompositeTrie.prefixMap(Object)
NavigableCompositeTrie<K,C,V> descendingMap()
descendingMap
in interface NavigableMap<K,V>
NavigableCompositeTrie<K,C,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
subMap
in interface NavigableMap<K,V>
NavigableCompositeTrie<K,C,V> headMap(K toKey, boolean inclusive)
headMap
in interface NavigableMap<K,V>
NavigableCompositeTrie<K,C,V> tailMap(K fromKey, boolean inclusive)
tailMap
in interface NavigableMap<K,V>
NavigableCompositeTrie<K,C,V> headMap(K toKey)