Class AbstractPatriciaTrie.RangeMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.apache.commons.collections4.trie.AbstractPatriciaTrie.RangeMap
-
- All Implemented Interfaces:
java.util.Map<K,V>
,java.util.SortedMap<K,V>
- Direct Known Subclasses:
AbstractPatriciaTrie.PrefixRangeMap
,AbstractPatriciaTrie.RangeEntryMap
- Enclosing class:
- AbstractPatriciaTrie<K,V>
private abstract class AbstractPatriciaTrie.RangeMap extends java.util.AbstractMap<K,V> implements java.util.SortedMap<K,V>
A range view of theTrie
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.util.Map.Entry<K,V>>
entrySet
TheentrySet()
view.
-
Constructor Summary
Constructors Modifier Constructor Description private
RangeMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Comparator<? super K>
comparator()
boolean
containsKey(java.lang.Object key)
protected abstract java.util.Set<java.util.Map.Entry<K,V>>
createEntrySet()
Creates and returns anentrySet()
view of theAbstractPatriciaTrie.RangeMap
.protected abstract 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
.java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
V
get(java.lang.Object key)
protected abstract K
getFromKey()
Returns the FROM Key.protected abstract K
getToKey()
Returns the TO Key.java.util.SortedMap<K,V>
headMap(K toKey)
protected boolean
inFromRange(K key, boolean forceInclusive)
Returns true if the provided key is in the FROM range of theAbstractPatriciaTrie.RangeMap
.protected boolean
inRange(K key)
Returns true if the provided key is greater than TO and less than FROM.protected boolean
inRange2(K key)
This form allows the high endpoint (as well as all legit keys).protected boolean
inToRange(K key, boolean forceInclusive)
Returns true if the provided key is in the TO range of theAbstractPatriciaTrie.RangeMap
.protected abstract boolean
isFromInclusive()
Whether or not thegetFromKey()
is in the range.protected abstract boolean
isToInclusive()
Whether or not thegetToKey()
is in the range.V
put(K key, V value)
V
remove(java.lang.Object key)
java.util.SortedMap<K,V>
subMap(K fromKey, K toKey)
java.util.SortedMap<K,V>
tailMap(K fromKey)
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
entrySet
private transient volatile java.util.Set<java.util.Map.Entry<K,V>> entrySet
TheentrySet()
view.
-
-
Method Detail
-
createEntrySet
protected abstract java.util.Set<java.util.Map.Entry<K,V>> createEntrySet()
Creates and returns anentrySet()
view of theAbstractPatriciaTrie.RangeMap
.
-
getFromKey
protected abstract K getFromKey()
Returns the FROM Key.
-
isFromInclusive
protected abstract boolean isFromInclusive()
Whether or not thegetFromKey()
is in the range.
-
getToKey
protected abstract K getToKey()
Returns the TO Key.
-
isToInclusive
protected abstract boolean isToInclusive()
Whether or not thegetToKey()
is in the range.
-
comparator
public java.util.Comparator<? super K> comparator()
-
containsKey
public boolean containsKey(java.lang.Object key)
-
remove
public V remove(java.lang.Object key)
-
get
public V get(java.lang.Object key)
-
inRange
protected boolean inRange(K key)
Returns true if the provided key is greater than TO and less than FROM.
-
inRange2
protected boolean inRange2(K key)
This form allows the high endpoint (as well as all legit keys).
-
inFromRange
protected boolean inFromRange(K key, boolean forceInclusive)
Returns true if the provided key is in the FROM range of theAbstractPatriciaTrie.RangeMap
.
-
inToRange
protected boolean inToRange(K key, boolean forceInclusive)
Returns true if the provided key is in the TO range of theAbstractPatriciaTrie.RangeMap
.
-
createRangeMap
protected abstract 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
.
-
-