Package com.tangosol.util
Class SafeSortedMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentSkipListMap
com.tangosol.util.SafeSortedMap
- All Implemented Interfaces:
Serializable,Cloneable,ConcurrentMap,ConcurrentNavigableMap,Map,NavigableMap,SortedMap
Implementation of a
SortedMap extending ConcurrentSkipListMap
to support null keys and null values. Note that unlike its super class, this class is not serializable.- Since:
- 23.03
- Author:
- mg
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classEntry set delegation of the super map implementation.protected static classKey set delegation of the super map implementation.static classprotected static classMap.Entry implementation that supports null key/value placeholders.protected static classSubMap delegation to manageNULLin entry key and/or value.protected static classValues delegation of the super map implementation.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct 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. -
Method Summary
Modifier and TypeMethodDescriptionclone()compute(Object oKey, BiFunction remappingFunction) computeIfAbsent(Object oKey, Function mappingFunction) computeIfPresent(Object oKey, BiFunction remappingFunction) booleancontainsKey(Object oKey) booleancontainsValue(Object oValue) entrySet()booleanfirstKey()voidforEach(BiConsumer action) Locate a Map.Entry in this map based on its key.getOrDefault(Object oKey, Object oDefaultValue) keySet()lastKey()merge(Object oKey, Object oValue, BiFunction remappingFunction) putIfAbsent(Object oKey, Object oValue) booleanbooleanvoidreplaceAll(BiFunction function) values()Methods inherited from class java.util.concurrent.ConcurrentSkipListMap
ceilingEntry, ceilingKey, clear, comparator, firstEntry, floorEntry, floorKey, higherEntry, higherKey, isEmpty, lastEntry, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, sizeMethods inherited from class java.util.AbstractMap
hashCode, putAll, toString
-
Field Details
-
NULL
Placeholder for anullkey or value.
-
-
Constructor Details
-
SafeSortedMap
public SafeSortedMap()Construct a new SafeSortedMap using the natural ordering of the Comparable keys in this map. -
SafeSortedMap
Construct a new SafeSortedMap copying the contents of the specified map.- Parameters:
that- the map copied
-
SafeSortedMap
Construct a new SafeSortedMap with the specified Comparator.- Parameters:
comparator- the comparator used to sort this map
-
-
Method Details
-
get
- Specified by:
getin interfaceMap- Overrides:
getin classConcurrentSkipListMap
-
put
- Specified by:
putin interfaceMap- Overrides:
putin classConcurrentSkipListMap
-
remove
- Specified by:
removein interfaceMap- Overrides:
removein classConcurrentSkipListMap
-
equals
- Specified by:
equalsin interfaceMap- Overrides:
equalsin classConcurrentSkipListMap
-
clone
- Overrides:
clonein classConcurrentSkipListMap
-
containsKey
- Specified by:
containsKeyin interfaceMap- Overrides:
containsKeyin classConcurrentSkipListMap
-
containsValue
- Specified by:
containsValuein interfaceMap- Overrides:
containsValuein classConcurrentSkipListMap
-
entrySet
-
keySet
- Specified by:
keySetin interfaceConcurrentNavigableMap- Specified by:
keySetin interfaceMap- Specified by:
keySetin interfaceSortedMap- Overrides:
keySetin classConcurrentSkipListMap
-
values
-
descendingMap
- Specified by:
descendingMapin interfaceConcurrentNavigableMap- Specified by:
descendingMapin interfaceNavigableMap- Overrides:
descendingMapin classConcurrentSkipListMap
-
descendingKeySet
- Specified by:
descendingKeySetin interfaceConcurrentNavigableMap- Specified by:
descendingKeySetin interfaceNavigableMap- Overrides:
descendingKeySetin classConcurrentSkipListMap
-
getEntry
Locate a Map.Entry in this map based on its key.Note: the behaviour of {#setValue} on the returned Entry is undefined in the presence of concurrent modifications
- Parameters:
oKey- the key to return an Entry for- Returns:
- an Entry corresponding to the specified key, or null if none exists
-
firstKey
- Specified by:
firstKeyin interfaceSortedMap- Overrides:
firstKeyin classConcurrentSkipListMap
-
lastKey
- Specified by:
lastKeyin interfaceSortedMap- Overrides:
lastKeyin classConcurrentSkipListMap
-
subMap
public ConcurrentNavigableMap subMap(Object oFromKey, boolean fFromInclusive, Object oToKey, boolean fToInclusive) - Specified by:
subMapin interfaceConcurrentNavigableMap- Specified by:
subMapin interfaceNavigableMap- Overrides:
subMapin classConcurrentSkipListMap
-
headMap
- Specified by:
headMapin interfaceConcurrentNavigableMap- Specified by:
headMapin interfaceNavigableMap- Overrides:
headMapin classConcurrentSkipListMap
-
tailMap
- Specified by:
tailMapin interfaceConcurrentNavigableMap- Specified by:
tailMapin interfaceNavigableMap- Overrides:
tailMapin classConcurrentSkipListMap
-
subMap
- Specified by:
subMapin interfaceConcurrentNavigableMap- Specified by:
subMapin interfaceNavigableMap- Specified by:
subMapin interfaceSortedMap- Overrides:
subMapin classConcurrentSkipListMap
-
headMap
- Specified by:
headMapin interfaceConcurrentNavigableMap- Specified by:
headMapin interfaceNavigableMap- Specified by:
headMapin interfaceSortedMap- Overrides:
headMapin classConcurrentSkipListMap
-
tailMap
- Specified by:
tailMapin interfaceConcurrentNavigableMap- Specified by:
tailMapin interfaceNavigableMap- Specified by:
tailMapin interfaceSortedMap- Overrides:
tailMapin classConcurrentSkipListMap
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceConcurrentMap- Specified by:
putIfAbsentin interfaceMap- Overrides:
putIfAbsentin classConcurrentSkipListMap
-
getOrDefault
- Specified by:
getOrDefaultin interfaceConcurrentMap- Specified by:
getOrDefaultin interfaceMap- Overrides:
getOrDefaultin classConcurrentSkipListMap
-
forEach
- Specified by:
forEachin interfaceConcurrentMap- Specified by:
forEachin interfaceMap- Overrides:
forEachin classConcurrentSkipListMap
-
remove
- Specified by:
removein interfaceConcurrentMap- Specified by:
removein interfaceMap- Overrides:
removein classConcurrentSkipListMap
-
replace
- Specified by:
replacein interfaceConcurrentMap- Specified by:
replacein interfaceMap- Overrides:
replacein classConcurrentSkipListMap
-
replace
- Specified by:
replacein interfaceConcurrentMap- Specified by:
replacein interfaceMap- Overrides:
replacein classConcurrentSkipListMap
-
replaceAll
- Specified by:
replaceAllin interfaceConcurrentMap- Specified by:
replaceAllin interfaceMap- Overrides:
replaceAllin classConcurrentSkipListMap
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceConcurrentMap- Specified by:
computeIfAbsentin interfaceMap- Overrides:
computeIfAbsentin classConcurrentSkipListMap
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceConcurrentMap- Specified by:
computeIfPresentin interfaceMap- Overrides:
computeIfPresentin classConcurrentSkipListMap
-
compute
- Specified by:
computein interfaceConcurrentMap- Specified by:
computein interfaceMap- Overrides:
computein classConcurrentSkipListMap
-
merge
- Specified by:
mergein interfaceConcurrentMap- Specified by:
mergein interfaceMap- Overrides:
mergein classConcurrentSkipListMap
-