private class AbstractPatriciaTrie.PrefixRangeMap extends AbstractPatriciaTrie.RangeMap
Trie
.Modifier and Type | Field and Description |
---|---|
private int |
expectedModCount |
private K |
fromKey |
private int |
lengthInBits |
private int |
offsetInBits |
private K |
prefix |
private int |
size |
private K |
toKey |
Modifier | Constructor and Description |
---|---|
private |
PrefixRangeMap(K prefix,
int offsetInBits,
int lengthInBits)
Creates a
AbstractPatriciaTrie.PrefixRangeMap . |
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<java.util.Map.Entry<K,V>> |
createEntrySet()
Creates and returns an
AbstractPatriciaTrie.RangeMap.entrySet() view of the AbstractPatriciaTrie.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 current
AbstractPatriciaTrie.RangeMap . |
K |
firstKey() |
private int |
fixup()
This method does two things.
|
K |
getFromKey()
Returns the FROM Key.
|
K |
getToKey()
Returns the TO Key.
|
protected boolean |
inFromRange(K key,
boolean forceInclusive)
Returns true if the provided Key is in the FROM range of the
AbstractPatriciaTrie.PrefixRangeMap . |
protected boolean |
inRange(K key)
Returns true if this
AbstractPatriciaTrie.PrefixRangeMap 's key is a prefix of the provided key. |
protected boolean |
inRange2(K key)
Same as
inRange(Object) . |
protected boolean |
inToRange(K key,
boolean forceInclusive)
Returns true if the provided Key is in the TO range of the
AbstractPatriciaTrie.PrefixRangeMap . |
boolean |
isFromInclusive()
Whether or not the
AbstractPatriciaTrie.RangeMap.getFromKey() is in the range. |
boolean |
isToInclusive()
Whether or not the
AbstractPatriciaTrie.RangeMap.getToKey() is in the range. |
K |
lastKey() |
comparator, containsKey, entrySet, get, headMap, put, remove, subMap, tailMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
private final K prefix
private final int offsetInBits
private final int lengthInBits
private K fromKey
private K toKey
private transient int expectedModCount
private int size
private PrefixRangeMap(K prefix, int offsetInBits, int lengthInBits)
AbstractPatriciaTrie.PrefixRangeMap
.private int fixup()
AbstractPatriciaTrie.PrefixRangeMap
and the number
of elements in the range. This method must be called every
time the Trie
has changed.public K firstKey()
public K lastKey()
protected boolean inRange(K key)
AbstractPatriciaTrie.PrefixRangeMap
's key is a prefix of the provided key.inRange
in class AbstractPatriciaTrie.RangeMap
protected boolean inRange2(K key)
inRange(Object)
.inRange2
in class AbstractPatriciaTrie.RangeMap
protected boolean inFromRange(K key, boolean forceInclusive)
AbstractPatriciaTrie.PrefixRangeMap
.inFromRange
in class AbstractPatriciaTrie.RangeMap
protected boolean inToRange(K key, boolean forceInclusive)
AbstractPatriciaTrie.PrefixRangeMap
.inToRange
in class AbstractPatriciaTrie.RangeMap
protected java.util.Set<java.util.Map.Entry<K,V>> createEntrySet()
AbstractPatriciaTrie.RangeMap
AbstractPatriciaTrie.RangeMap.entrySet()
view of the AbstractPatriciaTrie.RangeMap
.createEntrySet
in class AbstractPatriciaTrie.RangeMap
public K getFromKey()
AbstractPatriciaTrie.RangeMap
getFromKey
in class AbstractPatriciaTrie.RangeMap
public K getToKey()
AbstractPatriciaTrie.RangeMap
getToKey
in class AbstractPatriciaTrie.RangeMap
public boolean isFromInclusive()
AbstractPatriciaTrie.RangeMap
AbstractPatriciaTrie.RangeMap.getFromKey()
is in the range.isFromInclusive
in class AbstractPatriciaTrie.RangeMap
public boolean isToInclusive()
AbstractPatriciaTrie.RangeMap
AbstractPatriciaTrie.RangeMap.getToKey()
is in the range.isToInclusive
in class AbstractPatriciaTrie.RangeMap
protected java.util.SortedMap<K,V> createRangeMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
AbstractPatriciaTrie.RangeMap
AbstractPatriciaTrie.RangeMap
.createRangeMap
in class AbstractPatriciaTrie.RangeMap