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
public class SafeSortedMap extends ConcurrentSkipListMap
Implementation of aSortedMapextendingConcurrentSkipListMapto support null keys and null values. Note that unlike its super class, this class is not serializable.- Since:
- 23.03
- Author:
- mg
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classSafeSortedMap.EntrySetEntry set delegation of the super map implementation.protected static classSafeSortedMap.KeySetKey set delegation of the super map implementation.static classSafeSortedMap.Nullprotected static classSafeSortedMap.NullableEntryMap.Entry implementation that supports null key/value placeholders.protected static classSafeSortedMap.SubMapSubMap delegation to manageNULLin entry key and/or value.protected static classSafeSortedMap.ValuesValues 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>
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
-
Methods inherited from class java.util.concurrent.ConcurrentSkipListMap
ceilingEntry, ceilingKey, clear, comparator, firstEntry, floorEntry, floorKey, higherEntry, higherKey, isEmpty, lastEntry, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, size
-
Methods inherited from class java.util.AbstractMap
hashCode, putAll, toString
-
-
-
-
Constructor Detail
-
SafeSortedMap
public SafeSortedMap()
Construct a new SafeSortedMap using the natural ordering of the Comparable keys in this map.
-
SafeSortedMap
public SafeSortedMap(SortedMap that)
Construct a new SafeSortedMap copying the contents of the specified map.- Parameters:
that- the map copied
-
SafeSortedMap
public SafeSortedMap(Comparator comparator)
Construct a new SafeSortedMap with the specified Comparator.- Parameters:
comparator- the comparator used to sort this map
-
-
Method Detail
-
get
public Object get(Object oKey)
- Specified by:
getin interfaceMap- Overrides:
getin classConcurrentSkipListMap
-
put
public Object put(Object oKey, Object oValue)
- Specified by:
putin interfaceMap- Overrides:
putin classConcurrentSkipListMap
-
remove
public Object remove(Object oKey)
- Specified by:
removein interfaceMap- Overrides:
removein classConcurrentSkipListMap
-
equals
public boolean equals(Object oMap)
- Specified by:
equalsin interfaceMap- Overrides:
equalsin classConcurrentSkipListMap
-
clone
public SafeSortedMap clone()
- Overrides:
clonein classConcurrentSkipListMap
-
containsKey
public boolean containsKey(Object oKey)
- Specified by:
containsKeyin interfaceMap- Overrides:
containsKeyin classConcurrentSkipListMap
-
containsValue
public boolean containsValue(Object oValue)
- Specified by:
containsValuein interfaceMap- Overrides:
containsValuein classConcurrentSkipListMap
-
keySet
public NavigableSet keySet()
- Specified by:
keySetin interfaceConcurrentNavigableMap- Specified by:
keySetin interfaceMap- Specified by:
keySetin interfaceSortedMap- Overrides:
keySetin classConcurrentSkipListMap
-
values
public Collection values()
-
descendingMap
public ConcurrentNavigableMap descendingMap()
- Specified by:
descendingMapin interfaceConcurrentNavigableMap- Specified by:
descendingMapin interfaceNavigableMap- Overrides:
descendingMapin classConcurrentSkipListMap
-
descendingKeySet
public NavigableSet descendingKeySet()
- Specified by:
descendingKeySetin interfaceConcurrentNavigableMap- Specified by:
descendingKeySetin interfaceNavigableMap- Overrides:
descendingKeySetin classConcurrentSkipListMap
-
getEntry
public Map.Entry getEntry(Object oKey)
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
public Object firstKey()
- Specified by:
firstKeyin interfaceSortedMap- Overrides:
firstKeyin classConcurrentSkipListMap
-
lastKey
public Object 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
public ConcurrentNavigableMap headMap(Object oToKey, boolean fInclusive)
- Specified by:
headMapin interfaceConcurrentNavigableMap- Specified by:
headMapin interfaceNavigableMap- Overrides:
headMapin classConcurrentSkipListMap
-
tailMap
public ConcurrentNavigableMap tailMap(Object oFromKey, boolean fInclusive)
- Specified by:
tailMapin interfaceConcurrentNavigableMap- Specified by:
tailMapin interfaceNavigableMap- Overrides:
tailMapin classConcurrentSkipListMap
-
subMap
public ConcurrentNavigableMap subMap(Object oFromKey, Object oToKey)
- Specified by:
subMapin interfaceConcurrentNavigableMap- Specified by:
subMapin interfaceNavigableMap- Specified by:
subMapin interfaceSortedMap- Overrides:
subMapin classConcurrentSkipListMap
-
headMap
public ConcurrentNavigableMap headMap(Object oToKey)
- Specified by:
headMapin interfaceConcurrentNavigableMap- Specified by:
headMapin interfaceNavigableMap- Specified by:
headMapin interfaceSortedMap- Overrides:
headMapin classConcurrentSkipListMap
-
tailMap
public ConcurrentNavigableMap tailMap(Object fromKey)
- Specified by:
tailMapin interfaceConcurrentNavigableMap- Specified by:
tailMapin interfaceNavigableMap- Specified by:
tailMapin interfaceSortedMap- Overrides:
tailMapin classConcurrentSkipListMap
-
putIfAbsent
public Object putIfAbsent(Object oKey, Object oValue)
- Specified by:
putIfAbsentin interfaceConcurrentMap- Specified by:
putIfAbsentin interfaceMap- Overrides:
putIfAbsentin classConcurrentSkipListMap
-
getOrDefault
public Object getOrDefault(Object oKey, Object oDefaultValue)
- Specified by:
getOrDefaultin interfaceConcurrentMap- Specified by:
getOrDefaultin interfaceMap- Overrides:
getOrDefaultin classConcurrentSkipListMap
-
forEach
public void forEach(BiConsumer action)
- Specified by:
forEachin interfaceConcurrentMap- Specified by:
forEachin interfaceMap- Overrides:
forEachin classConcurrentSkipListMap
-
remove
public boolean remove(Object oKey, Object oValue)
- Specified by:
removein interfaceConcurrentMap- Specified by:
removein interfaceMap- Overrides:
removein classConcurrentSkipListMap
-
replace
public boolean replace(Object oKey, Object oOldValue, Object oNewValue)
- Specified by:
replacein interfaceConcurrentMap- Specified by:
replacein interfaceMap- Overrides:
replacein classConcurrentSkipListMap
-
replace
public Object replace(Object oKey, Object oValue)
- Specified by:
replacein interfaceConcurrentMap- Specified by:
replacein interfaceMap- Overrides:
replacein classConcurrentSkipListMap
-
replaceAll
public void replaceAll(BiFunction function)
- Specified by:
replaceAllin interfaceConcurrentMap- Specified by:
replaceAllin interfaceMap- Overrides:
replaceAllin classConcurrentSkipListMap
-
computeIfAbsent
public Object computeIfAbsent(Object oKey, Function mappingFunction)
- Specified by:
computeIfAbsentin interfaceConcurrentMap- Specified by:
computeIfAbsentin interfaceMap- Overrides:
computeIfAbsentin classConcurrentSkipListMap
-
computeIfPresent
public Object computeIfPresent(Object oKey, BiFunction remappingFunction)
- Specified by:
computeIfPresentin interfaceConcurrentMap- Specified by:
computeIfPresentin interfaceMap- Overrides:
computeIfPresentin classConcurrentSkipListMap
-
compute
public Object compute(Object oKey, BiFunction remappingFunction)
- Specified by:
computein interfaceConcurrentMap- Specified by:
computein interfaceMap- Overrides:
computein classConcurrentSkipListMap
-
merge
public Object merge(Object oKey, Object oValue, BiFunction remappingFunction)
- Specified by:
mergein interfaceConcurrentMap- Specified by:
mergein interfaceMap- Overrides:
mergein classConcurrentSkipListMap
-
-