public interface AssistTimedMap<K,V> extends Map<K,V>
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
AssistTimedMap.RemoveAssister<K,V>
移除助理
|
static interface |
AssistTimedMap.TimeOutAssister<K,V>
超时助理
|
static class |
AssistTimedMap.TtlAssister<K,V>
定期超时
|
| 限定符和类型 | 方法和说明 |
|---|---|
Map<K,V> |
cleanExpire()
清理过期,返回被清理的键值对
不需要不定时清理,建议在容量达到某大小时清理
|
V |
getBy(K key) |
Runnable |
getCleanTask()
获取清理任务
|
default V |
put(K key,
V value)
存放一个键值对
|
V |
put(K key,
V value,
AssistTimedMap.TimeOutAssister<K,V> tAssister,
AssistTimedMap.RemoveAssister<K,V> rAssister)
存放一个键值对,该键值超时访问自动删除
|
default V |
put(K key,
V value,
long ttlMills)
存放一个键值对,该键值超时访问自动删除
|
default V |
put(K key,
V value,
long ttlMills,
AssistTimedMap.RemoveAssister<K,V> rAssister)
存放一个键值对,该键值超时访问自动删除
|
V |
removeBy(K key) |
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesV put(K key, V value, AssistTimedMap.TimeOutAssister<K,V> tAssister, AssistTimedMap.RemoveAssister<K,V> rAssister)
key - value - tAssister - 超时助理rAssister - 移除助理default V put(K key, V value, long ttlMills)
key - value - ttlMills - 超时毫秒default V put(K key, V value, long ttlMills, AssistTimedMap.RemoveAssister<K,V> rAssister)
key - value - ttlMills - 超时毫秒Runnable getCleanTask()
Copyright © 2020. All rights reserved.