Class AbstractPatriciaTrie.PrefixRangeMap
java.lang.Object
java.util.AbstractMap<K,V>
AbstractPatriciaTrie<K,V>.org.apache.commons.collections4.trie.AbstractPatriciaTrie.RangeMap
org.apache.commons.collections4.trie.AbstractPatriciaTrie.PrefixRangeMap
- Enclosing class:
AbstractPatriciaTrie<K,
V>
A submap used for prefix views over the
.
invalid reference
Trie
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PrefixRangeMap
(K prefix, int offsetInBits, int lengthInBits) Creates aAbstractPatriciaTrie<K,
.V>.PrefixRangeMap -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Creates and returns anAbstractPatriciaTrie.RangeMap.entrySet()
view of theAbstractPatriciaTrie<K,
.V>.RangeMap createRangeMap
(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) Creates and returns a sub-range view of the currentAbstractPatriciaTrie<K,
.V>.RangeMap firstKey()
private int
fixup()
This method does two things.Returns the FROM Key.getToKey()
Returns the TO Key.protected boolean
inFromRange
(K key, boolean forceInclusive) Returns true if the provided Key is in the FROM range of theAbstractPatriciaTrie<K,
.V>.PrefixRangeMap protected boolean
Returns true if thisAbstractPatriciaTrie<K,
's key is a prefix of the provided key.V>.PrefixRangeMap protected boolean
Same asinRange(Object)
.protected boolean
Returns true if the provided Key is in the TO range of theAbstractPatriciaTrie<K,
.V>.PrefixRangeMap boolean
Whether or not theAbstractPatriciaTrie.RangeMap.getFromKey()
is in the range.boolean
Whether or not theAbstractPatriciaTrie.RangeMap.getToKey()
is in the range.lastKey()
Methods inherited from class org.apache.commons.collections4.trie.AbstractPatriciaTrie.RangeMap
comparator, containsKey, entrySet, get, headMap, put, remove, subMap, tailMap
Methods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size
-
Field Details
-
prefix
-
offsetInBits
private final int offsetInBits -
lengthInBits
private final int lengthInBits -
fromKey
-
toKey
-
expectedModCount
private transient int expectedModCount -
size
private int size
-
-
Constructor Details
-
PrefixRangeMap
Creates aAbstractPatriciaTrie<K,
.V>.PrefixRangeMap
-
-
Method Details
-
fixup
private int fixup()This method does two things. It determines the FROM and TO range of theAbstractPatriciaTrie<K,
and the number of elements in the range. This method must be called every time theV>.PrefixRangeMap invalid reference
Trie
-
firstKey
-
lastKey
-
inRange
Returns true if thisAbstractPatriciaTrie<K,
's key is a prefix of the provided key.V>.PrefixRangeMap - Overrides:
inRange
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
inRange2
Same asinRange(Object)
.- Overrides:
inRange2
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
inFromRange
Returns true if the provided Key is in the FROM range of theAbstractPatriciaTrie<K,
.V>.PrefixRangeMap - Overrides:
inFromRange
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
inToRange
Returns true if the provided Key is in the TO range of theAbstractPatriciaTrie<K,
.V>.PrefixRangeMap - Overrides:
inToRange
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
createEntrySet
Description copied from class:AbstractPatriciaTrie.RangeMap
Creates and returns anAbstractPatriciaTrie.RangeMap.entrySet()
view of theAbstractPatriciaTrie<K,
.V>.RangeMap - Specified by:
createEntrySet
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
getFromKey
Description copied from class:AbstractPatriciaTrie.RangeMap
Returns the FROM Key.- Specified by:
getFromKey
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
getToKey
Description copied from class:AbstractPatriciaTrie.RangeMap
Returns the TO Key.- Specified by:
getToKey
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
isFromInclusive
public boolean isFromInclusive()Description copied from class:AbstractPatriciaTrie.RangeMap
Whether or not theAbstractPatriciaTrie.RangeMap.getFromKey()
is in the range.- Specified by:
isFromInclusive
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
isToInclusive
public boolean isToInclusive()Description copied from class:AbstractPatriciaTrie.RangeMap
Whether or not theAbstractPatriciaTrie.RangeMap.getToKey()
is in the range.- Specified by:
isToInclusive
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
createRangeMap
protected SortedMap<K,V> createRangeMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) Description copied from class:AbstractPatriciaTrie.RangeMap
Creates and returns a sub-range view of the currentAbstractPatriciaTrie<K,
.V>.RangeMap - Specified by:
createRangeMap
in classAbstractPatriciaTrie<K,
V>.RangeMap
-
clear
public void clear()
-