Class WeakConcurrentMap.WithInlinedExpunction<K,V>
- java.lang.Object
-
- java.lang.ref.ReferenceQueue<K>
-
- io.opentelemetry.context.internal.shaded.AbstractWeakConcurrentMap<K,V,io.opentelemetry.context.internal.shaded.WeakConcurrentMap.LookupKey<K>>
-
- io.opentelemetry.context.internal.shaded.WeakConcurrentMap<K,V>
-
- io.opentelemetry.context.internal.shaded.WeakConcurrentMap.WithInlinedExpunction<K,V>
-
- Enclosing class:
- WeakConcurrentMap<K,V>
public static class WeakConcurrentMap.WithInlinedExpunction<K,V> extends WeakConcurrentMap<K,V>
AWeakConcurrentMap
where stale entries are removed as a side effect of interacting with this map.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.opentelemetry.context.internal.shaded.WeakConcurrentMap
WeakConcurrentMap.WithInlinedExpunction<K,V>
-
Nested classes/interfaces inherited from class io.opentelemetry.context.internal.shaded.AbstractWeakConcurrentMap
AbstractWeakConcurrentMap.WeakKey<K>
-
-
Constructor Summary
Constructors Constructor Description WithInlinedExpunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
approximateSize()
Returns the approximate size of this map where the returned number is at least as big as the actual number of entries.boolean
containsKey(K key)
V
get(K key)
Iterator<Map.Entry<K,V>>
iterator()
V
put(K key, V value)
V
remove(K key)
-
Methods inherited from class io.opentelemetry.context.internal.shaded.WeakConcurrentMap
getCleanerThread, getLookupKey, resetLookupKey
-
Methods inherited from class io.opentelemetry.context.internal.shaded.AbstractWeakConcurrentMap
clear, defaultValue, expungeStaleEntries, getIfPresent, putIfAbsent, putIfProbablyAbsent, run, toString
-
Methods inherited from class java.lang.ref.ReferenceQueue
poll, remove, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
get
public V get(K key)
- Overrides:
get
in classAbstractWeakConcurrentMap<K,V,io.opentelemetry.context.internal.shaded.WeakConcurrentMap.LookupKey<K>>
- Parameters:
key
- The key of the entry.- Returns:
- The value of the entry or the default value if it did not exist.
-
containsKey
public boolean containsKey(K key)
- Overrides:
containsKey
in classAbstractWeakConcurrentMap<K,V,io.opentelemetry.context.internal.shaded.WeakConcurrentMap.LookupKey<K>>
- Parameters:
key
- The key of the entry.- Returns:
true
if the key already defines a value.
-
put
public V put(K key, V value)
- Overrides:
put
in classAbstractWeakConcurrentMap<K,V,io.opentelemetry.context.internal.shaded.WeakConcurrentMap.LookupKey<K>>
- Parameters:
key
- The key of the entry.value
- The value of the entry.- Returns:
- The previous entry or
null
if it does not exist.
-
remove
public V remove(K key)
- Overrides:
remove
in classAbstractWeakConcurrentMap<K,V,io.opentelemetry.context.internal.shaded.WeakConcurrentMap.LookupKey<K>>
- Parameters:
key
- The key of the entry.- Returns:
- The removed entry or
null
if it does not exist.
-
approximateSize
public int approximateSize()
Description copied from class:AbstractWeakConcurrentMap
Returns the approximate size of this map where the returned number is at least as big as the actual number of entries.- Overrides:
approximateSize
in classAbstractWeakConcurrentMap<K,V,io.opentelemetry.context.internal.shaded.WeakConcurrentMap.LookupKey<K>>
- Returns:
- The minimum size of this map.
-
-