Class ReferenceConcurrentMap<K,V>
java.lang.Object
org.miaixz.bus.core.center.map.reference.ReferenceConcurrentMap<K,V>
- Type Parameters:
K- 键类型V- 值类型
- All Implemented Interfaces:
Serializable,Iterable<Map.Entry<K,,V>> ConcurrentMap<K,,V> Map<K,V>
- Direct Known Subclasses:
SoftConcurrentMap,WeakConcurrentMap,WeakKeyConcurrentMap
public abstract class ReferenceConcurrentMap<K,V>
extends Object
implements ConcurrentMap<K,V>, Iterable<Map.Entry<K,V>>, Serializable
线程安全的ReferenceMap实现
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()voidforEach(BiConsumer<? super K, ? super V> action) booleanisEmpty()iterator()keySet()voidputIfAbsent(K key, V value) booleanbooleanvoidreplaceAll(BiFunction<? super K, ? super V, ? extends V> function) voidsetPurgeListener(BiConsumer<Ref<? extends K>, Ref<? extends V>> purgeListener) 设置对象回收清除监听intsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.ConcurrentMap
getOrDefaultMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ReferenceConcurrentMap
构造- Parameters:
raw-ConcurrentMap实现
-
-
Method Details
-
setPurgeListener
设置对象回收清除监听- Parameters:
purgeListener- 监听函数
-
size
public int size() -
isEmpty
public boolean isEmpty() -
get
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
put
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
putIfAbsentin interfaceMap<K,V>
-
putAll
-
replace
-
replace
-
replaceAll
- Specified by:
replaceAllin interfaceConcurrentMap<K,V> - Specified by:
replaceAllin interfaceMap<K,V>
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceConcurrentMap<K,V> - Specified by:
computeIfAbsentin interfaceMap<K,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceConcurrentMap<K,V> - Specified by:
computeIfPresentin interfaceMap<K,V>
-
remove
-
remove
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
forEach
-
iterator
-
compute
-
merge
-