static class ConcurrentSkipListMap.ConcurrentSkipListSubMap<K,V> extends java.util.AbstractMap<K,V> implements ConcurrentNavigableMap<K,V>, java.io.Serializable
ConcurrentSkipListMap submap operations
represent a subrange of mappings of their underlying
maps. Instances of this class support all methods of their
underlying maps, differing in that mappings outside their range are
ignored, and attempts to add mappings outside their ranges result
in IllegalArgumentException. Instances of this class are
constructed only using the subMap, headMap, and
tailMap methods of their underlying maps.| Modifier and Type | Class and Description |
|---|---|
(package private) class |
ConcurrentSkipListMap.ConcurrentSkipListSubMap.DescendingEntrySetView |
(package private) class |
ConcurrentSkipListMap.ConcurrentSkipListSubMap.DescendingKeySetView |
(package private) class |
ConcurrentSkipListMap.ConcurrentSkipListSubMap.EntrySetView |
(package private) class |
ConcurrentSkipListMap.ConcurrentSkipListSubMap.KeySetView |
(package private) class |
ConcurrentSkipListMap.ConcurrentSkipListSubMap.ValuesView |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.util.Map.Entry<K,V>> |
descendingEntrySetView |
private java.util.Set<K> |
descendingKeySetView |
private java.util.Set<java.util.Map.Entry<K,V>> |
entrySetView |
private K |
fence
upper fence key, or null if to end
|
private java.util.Set<K> |
keySetView |
private K |
least
lower bound key, or null if from start
|
private ConcurrentSkipListMap<K,V> |
m
Underlying map
|
private static long |
serialVersionUID |
private java.util.Collection<V> |
valuesView |
| Constructor and Description |
|---|
ConcurrentSkipListSubMap(ConcurrentSkipListMap<K,V> map,
K least,
K fence)
Creates a new submap.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map.Entry<K,V> |
ceilingEntry(K key)
Returns a key-value mapping associated with the least key
greater than or equal to the given key, or null if there is
no such entry.
|
K |
ceilingKey(K key)
Returns least key greater than or equal to the given key, or
null if there is no such key.
|
(package private) void |
checkKey(K key) |
void |
clear() |
java.util.Comparator<? super K> |
comparator() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<K,V>> |
descendingEntrySet()
Returns a set view of the mappings contained in this map, in
descending key order.
|
java.util.Set<K> |
descendingKeySet()
Returns a set view of the keys contained in this map, in
descending key order.
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
java.util.Map.Entry<K,V> |
firstEntry()
Returns a key-value mapping associated with the least
key in this map, or null if the map is empty.
|
K |
firstKey() |
(package private) ConcurrentSkipListMap.Node<K,V> |
firstNode() |
java.util.Map.Entry<K,V> |
floorEntry(K key)
Returns a key-value mapping associated with the greatest key
less than or equal to the given key, or null if there
is no such entry.
|
K |
floorKey(K key)
Returns the greatest key
less than or equal to the given key, or null if there
is no such key.
|
V |
get(java.lang.Object key) |
(package private) K |
getFence()
Returns fence key.
|
(package private) K |
getLeast()
Returns least key.
|
(package private) ConcurrentSkipListMap<K,V> |
getMap()
Returns underlying map.
|
ConcurrentNavigableMap<K,V> |
headMap(K toKey)
Returns a view of the portion of this map whose keys are strictly less
than toKey.
|
java.util.Map.Entry<K,V> |
higherEntry(K key)
Returns a key-value mapping associated with the least key
strictly greater than the given key, or null if there
is no such entry.
|
K |
higherKey(K key)
Returns the least key strictly greater than the given key, or
null if there is no such key.
|
(package private) boolean |
inHalfOpenRange(K key) |
(package private) boolean |
inOpenRange(K key) |
(package private) boolean |
isBeforeEnd(ConcurrentSkipListMap.Node<K,V> n) |
boolean |
isEmpty() |
java.util.Set<K> |
keySet() |
java.util.Map.Entry<K,V> |
lastEntry()
Returns a key-value mapping associated with the greatest
key in this map, or null if the map is empty.
|
K |
lastKey() |
(package private) ConcurrentSkipListMap.Node<K,V> |
lastNode() |
java.util.Map.Entry<K,V> |
lowerEntry(K key)
Returns a key-value mapping associated with the greatest
key strictly less than the given key, or null if there is no
such entry.
|
K |
lowerKey(K key)
Returns the greatest key strictly less than the given key, or
null if there is no such key.
|
java.util.Map.Entry<K,V> |
pollFirstEntry()
Removes and returns a key-value mapping associated with
the least key in this map, or null if the map is empty.
|
java.util.Map.Entry<K,V> |
pollLastEntry()
Removes and returns a key-value mapping associated with
the greatest key in this map, or null if the map is empty.
|
V |
put(K key,
V value) |
V |
putIfAbsent(K key,
V value) |
V |
remove(java.lang.Object key) |
boolean |
remove(java.lang.Object key,
java.lang.Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
int |
size() |
ConcurrentNavigableMap<K,V> |
subMap(K fromKey,
K toKey)
Returns a view of the portion of this map whose keys range from
fromKey, inclusive, to toKey, exclusive.
|
ConcurrentNavigableMap<K,V> |
tailMap(K fromKey)
Returns a view of the portion of this map whose keys are
greater than or equal to fromKey.
|
java.util.Collection<V> |
values() |
finalize, getClass, notify, notifyAll, wait, wait, waitprivate static final long serialVersionUID
private final ConcurrentSkipListMap<K,V> m
private final K least
private final K fence
private transient java.util.Set<K> keySetView
private transient java.util.Collection<V> valuesView
private transient java.util.Set<K> descendingKeySetView
ConcurrentSkipListSubMap(ConcurrentSkipListMap<K,V> map, K least, K fence)
least - inclusive least value, or null if from startfence - exclusive upper bound or null if to endjava.lang.IllegalArgumentException - if least and fence nonnull
and least greater than fenceboolean inHalfOpenRange(K key)
boolean inOpenRange(K key)
ConcurrentSkipListMap.Node<K,V> firstNode()
ConcurrentSkipListMap.Node<K,V> lastNode()
boolean isBeforeEnd(ConcurrentSkipListMap.Node<K,V> n)
void checkKey(K key) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionConcurrentSkipListMap<K,V> getMap()
K getLeast()
K getFence()
public boolean containsKey(java.lang.Object key)
public V get(java.lang.Object key)
public V remove(java.lang.Object key)
public int size()
public boolean isEmpty()
public boolean containsValue(java.lang.Object value)
public void clear()
public boolean remove(java.lang.Object key,
java.lang.Object value)
public java.util.Comparator<? super K> comparator()
public ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey)
ConcurrentNavigableMapsubMap in interface java.util.SortedMap<K,V>subMap in interface ConcurrentNavigableMap<K,V>subMap in interface NavigableMap<K,V>fromKey - low endpoint (inclusive) of the subMap.toKey - high endpoint (exclusive) of the subMap.public ConcurrentNavigableMap<K,V> headMap(K toKey)
ConcurrentNavigableMapheadMap in interface java.util.SortedMap<K,V>headMap in interface ConcurrentNavigableMap<K,V>headMap in interface NavigableMap<K,V>toKey - high endpoint (exclusive) of the headMap.public ConcurrentNavigableMap<K,V> tailMap(K fromKey)
ConcurrentNavigableMaptailMap in interface java.util.SortedMap<K,V>tailMap in interface ConcurrentNavigableMap<K,V>tailMap in interface NavigableMap<K,V>fromKey - low endpoint (inclusive) of the tailMap.public java.util.Map.Entry<K,V> ceilingEntry(K key)
NavigableMapceilingEntry in interface NavigableMap<K,V>key - the key.public K ceilingKey(K key)
NavigableMapceilingKey in interface NavigableMap<K,V>key - the key.public java.util.Map.Entry<K,V> lowerEntry(K key)
NavigableMaplowerEntry in interface NavigableMap<K,V>key - the key.public K lowerKey(K key)
NavigableMaplowerKey in interface NavigableMap<K,V>key - the key.public java.util.Map.Entry<K,V> floorEntry(K key)
NavigableMapfloorEntry in interface NavigableMap<K,V>key - the key.public K floorKey(K key)
NavigableMapfloorKey in interface NavigableMap<K,V>key - the key.public java.util.Map.Entry<K,V> higherEntry(K key)
NavigableMaphigherEntry in interface NavigableMap<K,V>key - the key.public K higherKey(K key)
NavigableMaphigherKey in interface NavigableMap<K,V>key - the key.public java.util.Map.Entry<K,V> firstEntry()
NavigableMapfirstEntry in interface NavigableMap<K,V>public java.util.Map.Entry<K,V> lastEntry()
NavigableMaplastEntry in interface NavigableMap<K,V>public java.util.Map.Entry<K,V> pollFirstEntry()
NavigableMappollFirstEntry in interface NavigableMap<K,V>public java.util.Map.Entry<K,V> pollLastEntry()
NavigableMappollLastEntry in interface NavigableMap<K,V>public java.util.Set<K> keySet()
public java.util.Set<K> descendingKeySet()
NavigableMapdescendingKeySet in interface NavigableMap<K,V>public java.util.Collection<V> values()
public java.util.Set<java.util.Map.Entry<K,V>> descendingEntrySet()
NavigableMapdescendingEntrySet in interface NavigableMap<K,V>