|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap
org.compass.core.util.backport.java.util.AbstractMap
org.compass.core.util.backport.java.util.concurrent.ConcurrentSkipListMap.SubMap
static final class ConcurrentSkipListMap.SubMap
Submaps returned by 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.
| Nested Class Summary | |
|---|---|
(package private) class |
ConcurrentSkipListMap.SubMap.SubMapEntryIterator
|
(package private) class |
ConcurrentSkipListMap.SubMap.SubMapIter
Variant of main Iter class to traverse through submaps. |
(package private) class |
ConcurrentSkipListMap.SubMap.SubMapKeyIterator
|
(package private) class |
ConcurrentSkipListMap.SubMap.SubMapValueIterator
|
| Nested classes/interfaces inherited from class org.compass.core.util.backport.java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry, AbstractMap.SimpleImmutableEntry |
| Constructor Summary | |
|---|---|
ConcurrentSkipListMap.SubMap(ConcurrentSkipListMap map,
Object fromKey,
boolean fromInclusive,
Object toKey,
boolean toInclusive,
boolean isDescending)
Creates a new submap, initializing all fields |
|
| Method Summary | |
|---|---|
Map.Entry |
ceilingEntry(Object 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 key. |
Object |
ceilingKey(Object key)
Returns the least key greater than or equal to the given key, or null if there is no such key. |
void |
clear()
|
Comparator |
comparator()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
NavigableSet |
descendingKeySet()
Returns a reverse order NavigableSet view of the keys contained in this map. |
NavigableMap |
descendingMap()
Returns a reverse order view of the mappings contained in this map. |
(package private) Iterator |
entryIterator()
|
Set |
entrySet()
|
Map.Entry |
firstEntry()
Returns a key-value mapping associated with the least key in this map, or null if the map is empty. |
Object |
firstKey()
|
Map.Entry |
floorEntry(Object 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 key. |
Object |
floorKey(Object key)
Returns the greatest key less than or equal to the given key, or null if there is no such key. |
Object |
get(Object key)
|
SortedMap |
headMap(Object toKey)
Equivalent to headMap(toKey, false). |
NavigableMap |
headMap(Object toKey,
boolean inclusive)
Returns a view of the portion of this map whose keys are less than (or equal to, if inclusive is true) toKey. |
Map.Entry |
higherEntry(Object key)
Returns a key-value mapping associated with the least key strictly greater than the given key, or null if there
is no such key. |
Object |
higherKey(Object key)
Returns the least key strictly greater than the given key, or null if there is no such key. |
boolean |
isEmpty()
|
(package private) Iterator |
keyIterator()
|
Set |
keySet()
|
Map.Entry |
lastEntry()
Returns a key-value mapping associated with the greatest key in this map, or null if the map is empty. |
Object |
lastKey()
|
Map.Entry |
lowerEntry(Object key)
Returns a key-value mapping associated with the greatest key strictly less than the given key, or null if there is
no such key. |
Object |
lowerKey(Object key)
Returns the greatest key strictly less than the given key, or null if there is no such key. |
NavigableSet |
navigableKeySet()
Returns a NavigableSet view of the keys contained in this map. |
Map.Entry |
pollFirstEntry()
Removes and returns a key-value mapping associated with the least key in this map, or null if the map is empty. |
Map.Entry |
pollLastEntry()
Removes and returns a key-value mapping associated with the greatest key in this map, or null if the map is empty. |
Object |
put(Object key,
Object value)
|
Object |
putIfAbsent(Object key,
Object value)
If the specified key is not already associated with a value, associate it with the given value. |
Object |
remove(Object key)
|
boolean |
remove(Object key,
Object value)
Removes the entry for a key only if currently mapped to a given value. |
Object |
replace(Object key,
Object value)
Replaces the entry for a key only if currently mapped to some value. |
boolean |
replace(Object key,
Object oldValue,
Object newValue)
Replaces the entry for a key only if currently mapped to a given value. |
int |
size()
|
NavigableMap |
subMap(Object fromKey,
boolean fromInclusive,
Object toKey,
boolean toInclusive)
Returns a view of the portion of this map whose keys range from fromKey to toKey. |
SortedMap |
subMap(Object fromKey,
Object toKey)
Equivalent to subMap(fromKey, true, toKey, false). |
SortedMap |
tailMap(Object fromKey)
Equivalent to tailMap(fromKey, true). |
NavigableMap |
tailMap(Object fromKey,
boolean inclusive)
Returns a view of the portion of this map whose keys are greater than (or equal to, if inclusive is true) fromKey. |
(package private) Iterator |
valueIterator()
|
Collection |
values()
|
| Methods inherited from class java.util.AbstractMap |
|---|
clone, equals, hashCode, putAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
ConcurrentSkipListMap.SubMap(ConcurrentSkipListMap map,
Object fromKey,
boolean fromInclusive,
Object toKey,
boolean toInclusive,
boolean isDescending)
| Method Detail |
|---|
public boolean containsKey(Object key)
containsKey in interface MapcontainsKey in class AbstractMappublic Object get(Object key)
get in interface Mapget in class AbstractMap
public Object put(Object key,
Object value)
put in interface Mapput in class AbstractMappublic Object remove(Object key)
remove in interface Mapremove in class AbstractMappublic int size()
size in interface Mapsize in class AbstractMappublic boolean isEmpty()
isEmpty in interface MapisEmpty in class AbstractMappublic boolean containsValue(Object value)
containsValue in interface MapcontainsValue in class AbstractMappublic void clear()
clear in interface Mapclear in class AbstractMap
public Object putIfAbsent(Object key,
Object value)
ConcurrentMap
if (!map.containsKey(key))
return map.put(key, value);
else
return map.get(key);
except that the action is performed atomically.
putIfAbsent in interface ConcurrentMapkey - key with which the specified value is to be associatedvalue - value to be associated with the specified key
public boolean remove(Object key,
Object value)
ConcurrentMap
if (map.containsKey(key) && map.get(key).equals(value)) {
map.remove(key);
return true;
} else return false;
except that the action is performed atomically.
remove in interface ConcurrentMapkey - key with which the specified value is associatedvalue - value expected to be associated with the specified key
public boolean replace(Object key,
Object oldValue,
Object newValue)
ConcurrentMap
if (map.containsKey(key) && map.get(key).equals(oldValue)) {
map.put(key, newValue);
return true;
} else return false;
except that the action is performed atomically.
replace in interface ConcurrentMapkey - key with which the specified value is associatedoldValue - value expected to be associated with the specified keynewValue - value to be associated with the specified key
public Object replace(Object key,
Object value)
ConcurrentMap
if (map.containsKey(key)) {
return map.put(key, value);
} else return null;
except that the action is performed atomically.
replace in interface ConcurrentMapkey - key with which the specified value is associatedvalue - value to be associated with the specified key
public Comparator comparator()
comparator in interface SortedMap
public NavigableMap subMap(Object fromKey,
boolean fromInclusive,
Object toKey,
boolean toInclusive)
NavigableMapfromKey to toKey. If fromKey and
toKey are equal, the returned map is empty unless
fromExclusive and toExclusive are both true. The
returned map is backed by this map, so changes in the returned map are
reflected in this map, and vice-versa. The returned map supports all
optional map operations that this map supports.
The returned map will throw an IllegalArgumentException
on an attempt to insert a key outside of its range, or to construct a
submap either of whose endpoints lie outside its range.
subMap in interface ConcurrentNavigableMapsubMap in interface NavigableMapfromKey - low endpoint of the keys in the returned mapfromInclusive - true if the low endpoint
is to be included in the returned viewtoKey - high endpoint of the keys in the returned maptoInclusive - true if the high endpoint
is to be included in the returned view
fromKey to toKey
public NavigableMap headMap(Object toKey,
boolean inclusive)
NavigableMapinclusive is true) toKey. The returned
map is backed by this map, so changes in the returned map are reflected
in this map, and vice-versa. The returned map supports all optional
map operations that this map supports.
The returned map will throw an IllegalArgumentException
on an attempt to insert a key outside its range.
headMap in interface ConcurrentNavigableMapheadMap in interface NavigableMaptoKey - high endpoint of the keys in the returned mapinclusive - true if the high endpoint
is to be included in the returned view
inclusive is true) toKey
public NavigableMap tailMap(Object fromKey,
boolean inclusive)
NavigableMapinclusive is true) fromKey. The returned
map is backed by this map, so changes in the returned map are reflected
in this map, and vice-versa. The returned map supports all optional
map operations that this map supports.
The returned map will throw an IllegalArgumentException
on an attempt to insert a key outside its range.
tailMap in interface ConcurrentNavigableMaptailMap in interface NavigableMapfromKey - low endpoint of the keys in the returned mapinclusive - true if the low endpoint
is to be included in the returned view
inclusive is true) fromKey
public SortedMap subMap(Object fromKey,
Object toKey)
NavigableMapEquivalent to subMap(fromKey, true, toKey, false).
subMap in interface SortedMapsubMap in interface ConcurrentNavigableMapsubMap in interface NavigableMappublic SortedMap headMap(Object toKey)
NavigableMapEquivalent to headMap(toKey, false).
headMap in interface SortedMapheadMap in interface ConcurrentNavigableMapheadMap in interface NavigableMappublic SortedMap tailMap(Object fromKey)
NavigableMapEquivalent to tailMap(fromKey, true).
tailMap in interface SortedMaptailMap in interface ConcurrentNavigableMaptailMap in interface NavigableMappublic NavigableMap descendingMap()
ConcurrentNavigableMapThe returned map has an ordering equivalent to
Collections.reverseOrder(comparator()).
The expression m.descendingMap().descendingMap() returns a
view of m essentially equivalent to m.
descendingMap in interface ConcurrentNavigableMapdescendingMap in interface NavigableMappublic Map.Entry ceilingEntry(Object key)
NavigableMapnull if
there is no such key.
ceilingEntry in interface NavigableMapkey - the key
key, or null if there is no such keypublic Object ceilingKey(Object key)
NavigableMapnull if there is no such key.
ceilingKey in interface NavigableMapkey - the key
key,
or null if there is no such keypublic Map.Entry lowerEntry(Object key)
NavigableMapnull if there is
no such key.
lowerEntry in interface NavigableMapkey - the key
key,
or null if there is no such keypublic Object lowerKey(Object key)
NavigableMapnull if there is no such key.
lowerKey in interface NavigableMapkey - the key
key,
or null if there is no such keypublic Map.Entry floorEntry(Object key)
NavigableMapnull if there
is no such key.
floorEntry in interface NavigableMapkey - the key
key, or null if there is no such keypublic Object floorKey(Object key)
NavigableMapnull if there is no such key.
floorKey in interface NavigableMapkey - the key
key,
or null if there is no such keypublic Map.Entry higherEntry(Object key)
NavigableMapnull if there
is no such key.
higherEntry in interface NavigableMapkey - the key
key,
or null if there is no such keypublic Object higherKey(Object key)
NavigableMapnull if there is no such key.
higherKey in interface NavigableMapkey - the key
key,
or null if there is no such keypublic Object firstKey()
firstKey in interface SortedMappublic Object lastKey()
lastKey in interface SortedMappublic Map.Entry firstEntry()
NavigableMapnull if the map is empty.
firstEntry in interface NavigableMapnull if this map is emptypublic Map.Entry lastEntry()
NavigableMapnull if the map is empty.
lastEntry in interface NavigableMapnull if this map is emptypublic Map.Entry pollFirstEntry()
NavigableMapnull if the map is empty.
pollFirstEntry in interface NavigableMapnull if this map is emptypublic Map.Entry pollLastEntry()
NavigableMapnull if the map is empty.
pollLastEntry in interface NavigableMapnull if this map is emptypublic Set keySet()
AbstractMap
keySet in interface MapkeySet in interface ConcurrentNavigableMapkeySet in class AbstractMappublic NavigableSet navigableKeySet()
ConcurrentNavigableMapNavigableSet view of the keys contained in this map.
The set's iterator returns the keys in ascending order.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. The set supports element
removal, which removes the corresponding mapping from the map,
via the Iterator.remove, Set.remove,
removeAll, retainAll, and clear
operations. It does not support the add or addAll
operations.
The view's iterator is a "weakly consistent" iterator
that will never throw ConcurrentModificationException,
and guarantees to traverse elements as they existed upon
construction of the iterator, and may (but is not guaranteed to)
reflect any modifications subsequent to construction.
navigableKeySet in interface ConcurrentNavigableMapnavigableKeySet in interface NavigableMappublic Collection values()
values in interface Mapvalues in class AbstractMappublic Set entrySet()
entrySet in interface MapentrySet in class AbstractMappublic NavigableSet descendingKeySet()
ConcurrentNavigableMapNavigableSet view of the keys contained in this map.
The set's iterator returns the keys in descending order.
The set is backed by the map, so changes to the map are
reflected in the set, and vice-versa. The set supports element
removal, which removes the corresponding mapping from the map,
via the Iterator.remove, Set.remove,
removeAll, retainAll, and clear
operations. It does not support the add or addAll
operations.
The view's iterator is a "weakly consistent" iterator
that will never throw ConcurrentModificationException,
and guarantees to traverse elements as they existed upon
construction of the iterator, and may (but is not guaranteed to)
reflect any modifications subsequent to construction.
descendingKeySet in interface ConcurrentNavigableMapdescendingKeySet in interface NavigableMapIterator keyIterator()
Iterator valueIterator()
Iterator entryIterator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||