Class AbstractPatriciaTrie.PrefixRangeMap
java.lang.Object
java.util.AbstractMap<K,V>
AbstractPatriciaTrie<K,V>.org.apache.commons.collections4.trie.AbstractPatriciaTrie.AbstractRangeMap
org.apache.commons.collections4.trie.AbstractPatriciaTrie.PrefixRangeMap
- Enclosing class:
AbstractPatriciaTrie<K,V>
private final class AbstractPatriciaTrie.PrefixRangeMap
extends AbstractPatriciaTrie<K,V>.AbstractRangeMap
A submap used for prefix views over the
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
ConstructorsModifierConstructorDescriptionprivatePrefixRangeMap(K prefix, int offsetInBits, int lengthInBits) Creates aAbstractPatriciaTrie<K,.V>.PrefixRangeMap -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Creates and returns anAbstractPatriciaTrie.AbstractRangeMap.entrySet()view of theAbstractPatriciaTrie<K,.V>.AbstractRangeMap createRangeMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) Creates and returns a sub-range view of the currentAbstractPatriciaTrie<K,.V>.AbstractRangeMap firstKey()private intfixup()This method does two things.Gets the FROM Key.getToKey()Gets 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 booleanTests whether or not theAbstractPatriciaTrie.AbstractRangeMap.getFromKey()is in the range.booleanTests whether or not theAbstractPatriciaTrie.AbstractRangeMap.getToKey()is in the range.lastKey()Methods inherited from class org.apache.commons.collections4.trie.AbstractPatriciaTrie.AbstractRangeMap
comparator, containsKey, entrySet, get, headMap, put, remove, subMap, tailMapMethods inherited from class java.util.AbstractMap
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
clear
public void clear() -
createEntrySet
Description copied from class:AbstractPatriciaTrie.AbstractRangeMapCreates and returns anAbstractPatriciaTrie.AbstractRangeMap.entrySet()view of theAbstractPatriciaTrie<K,.V>.AbstractRangeMap - Specified by:
createEntrySetin classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
createRangeMap
protected SortedMap<K,V> createRangeMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) Description copied from class:AbstractPatriciaTrie.AbstractRangeMapCreates and returns a sub-range view of the currentAbstractPatriciaTrie<K,.V>.AbstractRangeMap - Specified by:
createRangeMapin classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
firstKey
-
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 Triehas changed. -
getFromKey
Description copied from class:AbstractPatriciaTrie.AbstractRangeMapGets the FROM Key.- Specified by:
getFromKeyin classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
getToKey
Description copied from class:AbstractPatriciaTrie.AbstractRangeMapGets the TO Key.- Specified by:
getToKeyin classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
inFromRange
Returns true if the provided Key is in the FROM range of theAbstractPatriciaTrie<K,.V>.PrefixRangeMap - Overrides:
inFromRangein classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
inRange
Returns true if thisAbstractPatriciaTrie<K,'s key is a prefix of the provided key.V>.PrefixRangeMap - Overrides:
inRangein classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
inRange2
Same asinRange(Object).- Overrides:
inRange2in classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
inToRange
Returns true if the provided Key is in the TO range of theAbstractPatriciaTrie<K,.V>.PrefixRangeMap - Overrides:
inToRangein classAbstractPatriciaTrie<K,V>.AbstractRangeMap
-
isFromInclusive
public boolean isFromInclusive()Description copied from class:AbstractPatriciaTrie.AbstractRangeMapTests whether or not theAbstractPatriciaTrie.AbstractRangeMap.getFromKey()is in the range.- Specified by:
isFromInclusivein classAbstractPatriciaTrie<K,V>.AbstractRangeMap - Returns:
- whether or not the
AbstractPatriciaTrie.AbstractRangeMap.getFromKey()is in the range.
-
isToInclusive
public boolean isToInclusive()Description copied from class:AbstractPatriciaTrie.AbstractRangeMapTests whether or not theAbstractPatriciaTrie.AbstractRangeMap.getToKey()is in the range.- Specified by:
isToInclusivein classAbstractPatriciaTrie<K,V>.AbstractRangeMap - Returns:
- whether or not the
AbstractPatriciaTrie.AbstractRangeMap.getToKey()is in the range.
-
lastKey
-