public class ExpiryLRUMap<K,V> extends AbstractMap<K,V>
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ExpiryLRUMap.Node<V> |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 构造器和说明 |
|---|
ExpiryLRUMap() |
ExpiryLRUMap(int initialCapacity,
float loadFactor,
boolean accessOrder,
long defaultExpiryTime) |
ExpiryLRUMap(long defaultExpiryTime) |
| 限定符和类型 | 方法和说明 |
|---|---|
V |
atomicGet(K key,
Supplier<V> supplier) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
long |
getDefaultExpiryTime() |
long |
getHitCount() |
long |
getMissCount() |
ExpiryLRUMap.Node<V> |
getNode(K key) |
boolean |
isEmpty() |
boolean |
isReplaceNullValueFlag() |
Set<K> |
keySet() |
static void |
main(String[] args) |
V |
put(K key,
V value) |
V |
put(K key,
V value,
long expiryTime) |
ExpiryLRUMap.Node<V> |
putNode(K key,
ExpiryLRUMap.Node<V> value) |
V |
remove(Object key) |
boolean |
removeIfExpiry() |
ExpiryLRUMap.Node<V> |
removeNode(K key) |
void |
setDefaultExpiryTime(long defaultExpiryTime) |
void |
setRemoveEldestEntryFunction(Function<Map.Entry<K,ExpiryLRUMap.Node<V>>,Boolean> removeEldestEntryFunction) |
void |
setReplaceNullValueFlag(boolean replaceNullValueFlag) |
int |
size() |
String |
toString() |
Collection<V> |
values() |
clear, equals, hashCode, putAllcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic static final Object NULL
public ExpiryLRUMap()
public ExpiryLRUMap(long defaultExpiryTime)
public ExpiryLRUMap(int initialCapacity,
float loadFactor,
boolean accessOrder,
long defaultExpiryTime)
public void setRemoveEldestEntryFunction(Function<Map.Entry<K,ExpiryLRUMap.Node<V>>,Boolean> removeEldestEntryFunction)
public void setReplaceNullValueFlag(boolean replaceNullValueFlag)
public boolean isReplaceNullValueFlag()
public V put(K key, V value, long expiryTime)
key - keyvalue - valueexpiryTime - Key-value pair validity period milliseconds (Long. MAX VALUE means never expire)public boolean containsKey(Object key)
containsKey 在接口中 Map<K,V>containsKey 在类中 AbstractMap<K,V>public boolean containsValue(Object value)
containsValue 在接口中 Map<K,V>containsValue 在类中 AbstractMap<K,V>public long getMissCount()
public long getHitCount()
public ExpiryLRUMap.Node<V> getNode(K key)
public ExpiryLRUMap.Node<V> removeNode(K key)
public ExpiryLRUMap.Node<V> putNode(K key, ExpiryLRUMap.Node<V> value)
public Collection<V> values()
public boolean removeIfExpiry()
public long getDefaultExpiryTime()
public void setDefaultExpiryTime(long defaultExpiryTime)
public String toString()
toString 在类中 AbstractMap<K,V>public static void main(String[] args)
Copyright © 2020. All rights reserved.