Class WeakConcurrentMap.WithInlinedExpunction<K,V>
- java.lang.Object
-
- java.lang.ref.ReferenceQueue<K>
-
- org.mockito.internal.util.concurrent.WeakConcurrentMap<K,V>
-
- org.mockito.internal.util.concurrent.WeakConcurrentMap.WithInlinedExpunction<K,V>
-
- All Implemented Interfaces:
java.lang.Iterable<java.util.Map.Entry<K,V>>
,java.lang.Runnable
- 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 org.mockito.internal.util.concurrent.WeakConcurrentMap
WeakConcurrentMap.WithInlinedExpunction<K,V>
-
-
Field Summary
-
Fields inherited from class org.mockito.internal.util.concurrent.WeakConcurrentMap
target
-
-
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)
java.util.Iterator<java.util.Map.Entry<K,V>>
iterator()
V
put(K key, V value)
V
remove(K key)
-
Methods inherited from class org.mockito.internal.util.concurrent.WeakConcurrentMap
clear, defaultValue, expungeStaleEntries, getCleanerThread, run
-
-
-
-
Method Detail
-
get
public V get(K key)
- 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
public boolean containsKey(K key)
- Overrides:
containsKey
in classWeakConcurrentMap<K,V>
- 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 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
public V remove(K key)
- 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
public java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<K>
- Overrides:
iterator
in classWeakConcurrentMap<K,V>
-
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.
-
-