public class SafeSortedMap extends ConcurrentSkipListMap
SortedMap extending ConcurrentSkipListMap
to support null keys and null values. Note that unlike its super class, this class is not serializable.| Modifier and Type | Class and Description |
|---|---|
protected static class |
SafeSortedMap.EntrySet
Entry set delegation of the super map implementation.
|
protected static class |
SafeSortedMap.KeySet
Key set delegation of the super map implementation.
|
static class |
SafeSortedMap.Null |
protected static class |
SafeSortedMap.NullableEntry
Map.Entry implementation that supports null key/value placeholders.
|
protected static class |
SafeSortedMap.SubMap
SubMap delegation to manage
NULL in entry key and/or value. |
protected static class |
SafeSortedMap.Values
Values delegation of the super map implementation.
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
static SortedMap<?,?> |
EMPTY
An empty, immutable SafeSortedMap instance.
|
static Object |
NULL
Placeholder for a
null key or value. |
| Constructor and Description |
|---|
SafeSortedMap()
Construct a new SafeSortedMap using the natural ordering of the
Comparable keys in this map.
|
SafeSortedMap(Comparator comparator)
Construct a new SafeSortedMap with the specified Comparator.
|
SafeSortedMap(SortedMap that)
Construct a new SafeSortedMap copying the contents of the specified map.
|
ceilingEntry, ceilingKey, clear, comparator, firstEntry, floorEntry, floorKey, higherEntry, higherKey, isEmpty, lastEntry, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, sizehashCode, putAll, toStringpublic static final SortedMap<?,?> EMPTY
public static final Object NULL
null key or value.public SafeSortedMap()
public SafeSortedMap(SortedMap that)
that - the map copiedpublic SafeSortedMap(Comparator comparator)
comparator - the comparator used to sort this mappublic Object get(Object oKey)
get in interface Mapget in class ConcurrentSkipListMappublic Object put(Object oKey, Object oValue)
put in interface Mapput in class ConcurrentSkipListMappublic Object remove(Object oKey)
remove in interface Mapremove in class ConcurrentSkipListMappublic boolean equals(Object oMap)
equals in interface Mapequals in class ConcurrentSkipListMappublic SafeSortedMap clone()
clone in class ConcurrentSkipListMappublic boolean containsKey(Object oKey)
containsKey in interface MapcontainsKey in class ConcurrentSkipListMappublic boolean containsValue(Object oValue)
containsValue in interface MapcontainsValue in class ConcurrentSkipListMappublic NavigableSet keySet()
keySet in interface ConcurrentNavigableMapkeySet in interface MapkeySet in interface SortedMapkeySet in class ConcurrentSkipListMappublic Collection values()
public ConcurrentNavigableMap descendingMap()
descendingMap in interface ConcurrentNavigableMapdescendingMap in interface NavigableMapdescendingMap in class ConcurrentSkipListMappublic NavigableSet descendingKeySet()
descendingKeySet in interface ConcurrentNavigableMapdescendingKeySet in interface NavigableMapdescendingKeySet in class ConcurrentSkipListMappublic Map.Entry getEntry(Object oKey)
Note: the behaviour of {#setValue} on the returned Entry is undefined in the presence of concurrent modifications
oKey - the key to return an Entry forpublic Object firstKey()
firstKey in interface SortedMapfirstKey in class ConcurrentSkipListMappublic Object lastKey()
lastKey in interface SortedMaplastKey in class ConcurrentSkipListMappublic ConcurrentNavigableMap subMap(Object oFromKey, boolean fFromInclusive, Object oToKey, boolean fToInclusive)
subMap in interface ConcurrentNavigableMapsubMap in interface NavigableMapsubMap in class ConcurrentSkipListMappublic ConcurrentNavigableMap headMap(Object oToKey, boolean fInclusive)
headMap in interface ConcurrentNavigableMapheadMap in interface NavigableMapheadMap in class ConcurrentSkipListMappublic ConcurrentNavigableMap tailMap(Object oFromKey, boolean fInclusive)
tailMap in interface ConcurrentNavigableMaptailMap in interface NavigableMaptailMap in class ConcurrentSkipListMappublic ConcurrentNavigableMap subMap(Object oFromKey, Object oToKey)
subMap in interface ConcurrentNavigableMapsubMap in interface NavigableMapsubMap in interface SortedMapsubMap in class ConcurrentSkipListMappublic ConcurrentNavigableMap headMap(Object oToKey)
headMap in interface ConcurrentNavigableMapheadMap in interface NavigableMapheadMap in interface SortedMapheadMap in class ConcurrentSkipListMappublic ConcurrentNavigableMap tailMap(Object fromKey)
tailMap in interface ConcurrentNavigableMaptailMap in interface NavigableMaptailMap in interface SortedMaptailMap in class ConcurrentSkipListMappublic Object putIfAbsent(Object oKey, Object oValue)
putIfAbsent in interface ConcurrentMapputIfAbsent in interface MapputIfAbsent in class ConcurrentSkipListMappublic Object getOrDefault(Object oKey, Object oDefaultValue)
getOrDefault in interface ConcurrentMapgetOrDefault in interface MapgetOrDefault in class ConcurrentSkipListMappublic void forEach(BiConsumer action)
forEach in interface ConcurrentMapforEach in interface MapforEach in class ConcurrentSkipListMappublic boolean remove(Object oKey, Object oValue)
remove in interface ConcurrentMapremove in interface Mapremove in class ConcurrentSkipListMappublic boolean replace(Object oKey, Object oOldValue, Object oNewValue)
replace in interface ConcurrentMapreplace in interface Mapreplace in class ConcurrentSkipListMappublic Object replace(Object oKey, Object oValue)
replace in interface ConcurrentMapreplace in interface Mapreplace in class ConcurrentSkipListMappublic void replaceAll(BiFunction function)
replaceAll in interface ConcurrentMapreplaceAll in interface MapreplaceAll in class ConcurrentSkipListMappublic Object computeIfAbsent(Object oKey, Function mappingFunction)
computeIfAbsent in interface ConcurrentMapcomputeIfAbsent in interface MapcomputeIfAbsent in class ConcurrentSkipListMappublic Object computeIfPresent(Object oKey, BiFunction remappingFunction)
computeIfPresent in interface ConcurrentMapcomputeIfPresent in interface MapcomputeIfPresent in class ConcurrentSkipListMappublic Object compute(Object oKey, BiFunction remappingFunction)
compute in interface ConcurrentMapcompute in interface Mapcompute in class ConcurrentSkipListMappublic Object merge(Object oKey, Object oValue, BiFunction remappingFunction)
merge in interface ConcurrentMapmerge in interface Mapmerge in class ConcurrentSkipListMap