Class WeakConcurrentMap.WithInlinedExpunction<K,V>
java.lang.Object
java.lang.ref.ReferenceQueue<K>
com.pnfsoftware.jeb.util.concurrent.WeakConcurrentMap<K,V>
com.pnfsoftware.jeb.util.concurrent.WeakConcurrentMap.WithInlinedExpunction<K,V>
- Enclosing class:
- WeakConcurrentMap<K,
V>
A
WeakConcurrentMap
where stale entries are removed as a side effect of interacting
with this map.-
Nested Class Summary
Nested classes/interfaces inherited from class com.pnfsoftware.jeb.util.concurrent.WeakConcurrentMap
WeakConcurrentMap.WithInlinedExpunction<K,
V> -
Field Summary
Fields inherited from class com.pnfsoftware.jeb.util.concurrent.WeakConcurrentMap
target
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.pnfsoftware.jeb.util.concurrent.WeakConcurrentMap
clear, defaultValue, expungeStaleEntries, getCleanerThread, run
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, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
WithInlinedExpunction
public WithInlinedExpunction()
-
-
Method Details
-
get
- Overrides:
get
in classWeakConcurrentMap<K,
V> - Parameters:
key
- The key of the entry.- Returns:
- The value of the entry or the default value if it did not exist.
-
containsKey
- Overrides:
containsKey
in classWeakConcurrentMap<K,
V> - Parameters:
key
- The key of the entry.- Returns:
true
if the key already defines a value.
-
put
- Overrides:
put
in classWeakConcurrentMap<K,
V> - 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
- Overrides:
remove
in classWeakConcurrentMap<K,
V> - Parameters:
key
- The key of the entry.- Returns:
- The removed entry or
null
if it does not exist.
-
iterator
-
approximateSize
public int approximateSize()Description copied from class:WeakConcurrentMap
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 classWeakConcurrentMap<K,
V> - Returns:
- The minimum size of this map.
-