Class AbstractPatriciaTrie.PrefixRangeMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.apache.commons.collections4.trie.AbstractPatriciaTrie.RangeMap
-
- org.apache.commons.collections4.trie.AbstractPatriciaTrie.PrefixRangeMap
-
- All Implemented Interfaces:
java.util.Map<K,V>,java.util.SortedMap<K,V>
- Enclosing class:
- AbstractPatriciaTrie<K,V>
private class AbstractPatriciaTrie.PrefixRangeMap extends AbstractPatriciaTrie.RangeMap
A submap used for prefix views over theTrie.
-
-
Field Summary
Fields Modifier and Type Field Description private intexpectedModCountprivate KfromKeyprivate intlengthInBitsprivate intoffsetInBitsprivate Kprefixprivate intsizeprivate KtoKey
-
Constructor Summary
Constructors Modifier Constructor Description privatePrefixRangeMap(K prefix, int offsetInBits, int lengthInBits)Creates aAbstractPatriciaTrie.PrefixRangeMap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()protected java.util.Set<java.util.Map.Entry<K,V>>createEntrySet()Creates and returns anAbstractPatriciaTrie.RangeMap.entrySet()view of theAbstractPatriciaTrie.RangeMap.protected java.util.SortedMap<K,V>createRangeMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)Creates and returns a sub-range view of the currentAbstractPatriciaTrie.RangeMap.KfirstKey()private intfixup()This method does two things.KgetFromKey()Returns the FROM Key.KgetToKey()Returns the TO Key.protected booleaninFromRange(K key, boolean forceInclusive)Returns true if the provided Key is in the FROM range of theAbstractPatriciaTrie.PrefixRangeMap.protected booleaninRange(K key)Returns true if thisAbstractPatriciaTrie.PrefixRangeMap's key is a prefix of the provided key.protected booleaninRange2(K key)Same asinRange(Object).protected booleaninToRange(K key, boolean forceInclusive)Returns true if the provided Key is in the TO range of theAbstractPatriciaTrie.PrefixRangeMap.booleanisFromInclusive()Whether or not theAbstractPatriciaTrie.RangeMap.getFromKey()is in the range.booleanisToInclusive()Whether or not theAbstractPatriciaTrie.RangeMap.getToKey()is in the range.KlastKey()-
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
-
-
-
-
Constructor Detail
-
PrefixRangeMap
private PrefixRangeMap(K prefix, int offsetInBits, int lengthInBits)
Creates aAbstractPatriciaTrie.PrefixRangeMap.
-
-
Method Detail
-
fixup
private int fixup()
This method does two things. It determines the FROM and TO range of theAbstractPatriciaTrie.PrefixRangeMapand the number of elements in the range. This method must be called every time theTriehas changed.
-
firstKey
public K firstKey()
-
lastKey
public K lastKey()
-
inRange
protected boolean inRange(K key)
Returns true if thisAbstractPatriciaTrie.PrefixRangeMap's key is a prefix of the provided key.- Overrides:
inRangein classAbstractPatriciaTrie.RangeMap
-
inRange2
protected boolean inRange2(K key)
Same asinRange(Object).- Overrides:
inRange2in classAbstractPatriciaTrie.RangeMap
-
inFromRange
protected boolean inFromRange(K key, boolean forceInclusive)
Returns true if the provided Key is in the FROM range of theAbstractPatriciaTrie.PrefixRangeMap.- Overrides:
inFromRangein classAbstractPatriciaTrie.RangeMap
-
inToRange
protected boolean inToRange(K key, boolean forceInclusive)
Returns true if the provided Key is in the TO range of theAbstractPatriciaTrie.PrefixRangeMap.- Overrides:
inToRangein classAbstractPatriciaTrie.RangeMap
-
createEntrySet
protected java.util.Set<java.util.Map.Entry<K,V>> createEntrySet()
Description copied from class:AbstractPatriciaTrie.RangeMapCreates and returns anAbstractPatriciaTrie.RangeMap.entrySet()view of theAbstractPatriciaTrie.RangeMap.- Specified by:
createEntrySetin classAbstractPatriciaTrie.RangeMap
-
getFromKey
public K getFromKey()
Description copied from class:AbstractPatriciaTrie.RangeMapReturns the FROM Key.- Specified by:
getFromKeyin classAbstractPatriciaTrie.RangeMap
-
getToKey
public K getToKey()
Description copied from class:AbstractPatriciaTrie.RangeMapReturns the TO Key.- Specified by:
getToKeyin classAbstractPatriciaTrie.RangeMap
-
isFromInclusive
public boolean isFromInclusive()
Description copied from class:AbstractPatriciaTrie.RangeMapWhether or not theAbstractPatriciaTrie.RangeMap.getFromKey()is in the range.- Specified by:
isFromInclusivein classAbstractPatriciaTrie.RangeMap
-
isToInclusive
public boolean isToInclusive()
Description copied from class:AbstractPatriciaTrie.RangeMapWhether or not theAbstractPatriciaTrie.RangeMap.getToKey()is in the range.- Specified by:
isToInclusivein classAbstractPatriciaTrie.RangeMap
-
createRangeMap
protected java.util.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.RangeMap.- Specified by:
createRangeMapin classAbstractPatriciaTrie.RangeMap
-
-