K - V - public static class LruCache.CacheNode<K,V> extends LruHashMap.Node<K,V>
KvPair.EntryKvPair<K,V>| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
lastAccess
最后访问的时间戳
|
protected int |
lastReady
最后就绪/加载的时间戳
|
protected WeakReference<V> |
reference
以弱引用检查缓存值是否不可达到(用于确认没有其它引用,保证缓存的对象单例化)
|
protected LruCache.CacheNode<K,V> |
updatedNext
更新链表下一项
|
| 构造器和说明 |
|---|
LruCache.CacheNode(int hash,
K key,
V value,
LruHashMap.Node<K,V> next) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clean()
标记缓存项已刷写
|
V |
detach() |
void |
dirty() |
int |
getLastAccess() |
int |
getLastReady() |
LruCache.CacheNode<K,V> |
getLruAfter() |
LruCache.CacheNode<K,V> |
getLruBefore() |
LruCache.CacheNode<K,V> |
getUpdatedNext() |
V |
getValue()
取得缓存项的值,若处于分离状态则尝试转回正常的(强)引用状态
|
V |
getValueFast()
取得缓存项的值,若处于分离状态不恢复强引用只直接返回值
|
boolean |
isDirty() |
boolean |
isPending(V v) |
boolean |
isReady(V v,
int timeout) |
boolean |
isUnreachable() |
V |
pending(long timeout) |
protected boolean |
putLru(LruHashMap.Node<K,V> chain) |
void |
ready(V v) |
void |
reinit() |
boolean |
reloadNull(int timeout) |
V |
setValue(V v) |
String |
toString() |
getKey, hashCode, removeLruprotected volatile WeakReference<V> reference
protected int lastAccess
protected int lastReady
protected LruCache.CacheNode<K,V> updatedNext
public LruCache.CacheNode(int hash,
K key,
V value,
LruHashMap.Node<K,V> next)
public V detach()
public V getValue()
public V getValueFast()
public void reinit()
public void dirty()
public void clean()
public void ready(V v)
public V pending(long timeout) throws InterruptedException
public boolean isDirty()
public boolean isReady(V v, int timeout)
public boolean reloadNull(int timeout)
public boolean isPending(V v)
public boolean isUnreachable()
public LruCache.CacheNode<K,V> getLruAfter()
public LruCache.CacheNode<K,V> getLruBefore()
public LruCache.CacheNode<K,V> getUpdatedNext()
public int getLastAccess()
public int getLastReady()
protected boolean putLru(LruHashMap.Node<K,V> chain)
putLru 在类中 LruHashMap.Node<K,V>public String toString()
toString 在类中 LruHashMap.Node<K,V>Copyright © 2020. All rights reserved.