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>
AWeakConcurrentMapwhere 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 intapproximateSize()Returns the approximate size of this map where the returned number is at least as big as the actual number of entries.booleancontainsKey(K key)Vget(K key)java.util.Iterator<java.util.Map.Entry<K,V>>iterator()Vput(K key, V value)Vremove(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:
getin 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:
containsKeyin classWeakConcurrentMap<K,V>- Parameters:
key- The key of the entry.- Returns:
trueif the key already defines a value.
-
put
public V put(K key, V value)
- Overrides:
putin classWeakConcurrentMap<K,V>- Parameters:
key- The key of the entry.value- The value of the entry.- Returns:
- The previous entry or
nullif it does not exist.
-
remove
public V remove(K key)
- Overrides:
removein classWeakConcurrentMap<K,V>- Parameters:
key- The key of the entry.- Returns:
- The removed entry or
nullif it does not exist.
-
iterator
public java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<K>- Overrides:
iteratorin classWeakConcurrentMap<K,V>
-
approximateSize
public int approximateSize()
Description copied from class:WeakConcurrentMapReturns the approximate size of this map where the returned number is at least as big as the actual number of entries.- Overrides:
approximateSizein classWeakConcurrentMap<K,V>- Returns:
- The minimum size of this map.
-
-