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
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrefixRangeMap(K prefix, int offsetInBits, int lengthInBits) Creates aAbstractPatriciaTrie<K,.V>.PrefixRangeMap -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()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 intfixup()This method does two things.Returns the FROM Key.getToKey()Returns the TO Key.protected booleaninFromRange(K key, boolean forceInclusive) Returns true if the provided Key is in the FROM range of theAbstractPatriciaTrie<K,.V>.PrefixRangeMap protected booleanReturns true if thisAbstractPatriciaTrie<K,'s key is a prefix of the provided key.V>.PrefixRangeMap protected booleanSame asinRange(Object).protected booleanReturns true if the provided Key is in the TO range of theAbstractPatriciaTrie<K,.V>.PrefixRangeMap booleanWhether or not theAbstractPatriciaTrie.RangeMap.getFromKey()is in the range.booleanWhether or not theAbstractPatriciaTrie.RangeMap.getToKey()is in the range.lastKey()Methods inherited from class AbstractPatriciaTrie.RangeMap
comparator, containsKey, entrySet, get, headMap, put, remove, subMap, tailMapMethods inherited from class AbstractMap
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, valuesMethods inherited from interface 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 has changed.invalid reference
Trie -
firstKey
-
lastKey
-
inRange
Returns true if thisAbstractPatriciaTrie<K,'s key is a prefix of the provided key.V>.PrefixRangeMap - Overrides:
inRangein classAbstractPatriciaTrie<K,V>.RangeMap
-
inRange2
Same asinRange(Object).- Overrides:
inRange2in classAbstractPatriciaTrie<K,V>.RangeMap
-
inFromRange
Returns true if the provided Key is in the FROM range of theAbstractPatriciaTrie<K,.V>.PrefixRangeMap - Overrides:
inFromRangein classAbstractPatriciaTrie<K,V>.RangeMap
-
inToRange
Returns true if the provided Key is in the TO range of theAbstractPatriciaTrie<K,.V>.PrefixRangeMap - Overrides:
inToRangein classAbstractPatriciaTrie<K,V>.RangeMap
-
createEntrySet
Description copied from class:AbstractPatriciaTrie.RangeMapCreates and returns anAbstractPatriciaTrie.RangeMap.entrySet()view of theAbstractPatriciaTrie<K,.V>.RangeMap - Specified by:
createEntrySetin classAbstractPatriciaTrie<K,V>.RangeMap
-
getFromKey
Description copied from class:AbstractPatriciaTrie.RangeMapReturns the FROM Key.- Specified by:
getFromKeyin classAbstractPatriciaTrie<K,V>.RangeMap
-
getToKey
Description copied from class:AbstractPatriciaTrie.RangeMapReturns the TO Key.- Specified by:
getToKeyin classAbstractPatriciaTrie<K,V>.RangeMap
-
isFromInclusive
public boolean isFromInclusive()Description copied from class:AbstractPatriciaTrie.RangeMapWhether or not theAbstractPatriciaTrie.RangeMap.getFromKey()is in the range.- Specified by:
isFromInclusivein classAbstractPatriciaTrie<K,V>.RangeMap
-
isToInclusive
public boolean isToInclusive()Description copied from class:AbstractPatriciaTrie.RangeMapWhether or not theAbstractPatriciaTrie.RangeMap.getToKey()is in the range.- Specified by:
isToInclusivein classAbstractPatriciaTrie<K,V>.RangeMap
-
createRangeMap
protected SortedMap<K,V> createRangeMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) Description copied from class:AbstractPatriciaTrie.RangeMapCreates and returns a sub-range view of the currentAbstractPatriciaTrie<K,.V>.RangeMap - Specified by:
createRangeMapin classAbstractPatriciaTrie<K,V>.RangeMap
-
clear
-