K - 键类型V - 值类型public class ReferenceConcurrentMap<K,V> extends Object implements ConcurrentMap<K,V>, Iterable<Map.Entry<K,V>>, Serializable
| 构造器和说明 |
|---|
ReferenceConcurrentMap(ConcurrentMap<Reference<K>,V> raw,
ReferenceUtil.ReferenceType referenceType)
构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
V |
compute(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction) |
V |
computeIfAbsent(K key,
Func0<? extends V> supplier)
从缓存中获得对象,当对象不在缓存中或已经过期返回Func0回调产生的对象
|
V |
computeIfAbsent(K key,
Function<? super K,? extends V> mappingFunction) |
V |
computeIfPresent(K key,
BiFunction<? super K,? super V,? extends V> remappingFunction) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
void |
forEach(BiConsumer<? super K,? super V> action) |
V |
get(Object key) |
boolean |
isEmpty() |
Iterator<Map.Entry<K,V>> |
iterator() |
Set<K> |
keySet() |
V |
merge(K key,
V value,
BiFunction<? super V,? super V,? extends V> remappingFunction) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> m) |
V |
putIfAbsent(K key,
V value) |
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
void |
replaceAll(BiFunction<? super K,? super V,? extends V> function) |
void |
setPurgeListener(BiConsumer<Reference<? extends K>,V> purgeListener)
设置对象回收清除监听
|
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOrDefaultforEach, spliteratorpublic ReferenceConcurrentMap(ConcurrentMap<Reference<K>,V> raw, ReferenceUtil.ReferenceType referenceType)
raw - ConcurrentMap实现referenceType - Reference类型public void setPurgeListener(BiConsumer<Reference<? extends K>,V> purgeListener)
purgeListener - 监听函数public boolean containsKey(Object key)
containsKey 在接口中 Map<K,V>public boolean containsValue(Object value)
containsValue 在接口中 Map<K,V>public V putIfAbsent(K key, V value)
putIfAbsent 在接口中 ConcurrentMap<K,V>putIfAbsent 在接口中 Map<K,V>public void replaceAll(BiFunction<? super K,? super V,? extends V> function)
replaceAll 在接口中 ConcurrentMap<K,V>replaceAll 在接口中 Map<K,V>public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
computeIfAbsent 在接口中 ConcurrentMap<K,V>computeIfAbsent 在接口中 Map<K,V>public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
computeIfPresent 在接口中 ConcurrentMap<K,V>computeIfPresent 在接口中 Map<K,V>public V computeIfAbsent(K key, Func0<? extends V> supplier)
key - 键supplier - 如果不存在回调方法,用于生产值对象public void forEach(BiConsumer<? super K,? super V> action)
Copyright © 2022. All rights reserved.