Package com.google.common.cache
Class LocalCache.WeakEntry<K,V>
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.WeakReference<K>
-
- com.google.common.cache.LocalCache.WeakEntry<K,V>
-
- All Implemented Interfaces:
ReferenceEntry<K,V>
- Direct Known Subclasses:
LocalCache.WeakAccessEntry,LocalCache.WeakAccessWriteEntry,LocalCache.WeakWriteEntry
- Enclosing class:
- LocalCache<K,V>
static class LocalCache.WeakEntry<K,V> extends java.lang.ref.WeakReference<K> implements ReferenceEntry<K,V>
Used for weakly-referenced keys.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) inthash(package private) ReferenceEntry<K,V>next(package private) LocalCache.ValueReference<K,V>valueReference
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetAccessTime()Returns the time that this entry was last accessed, in ns.intgetHash()Returns the entry's hash.KgetKey()Returns the key for this entry.ReferenceEntry<K,V>getNext()Returns the next entry in the chain.ReferenceEntry<K,V>getNextInAccessQueue()Returns the next entry in the access queue.ReferenceEntry<K,V>getNextInWriteQueue()Returns the next entry in the write queue.ReferenceEntry<K,V>getPreviousInAccessQueue()Returns the previous entry in the access queue.ReferenceEntry<K,V>getPreviousInWriteQueue()Returns the previous entry in the write queue.LocalCache.ValueReference<K,V>getValueReference()Returns the value reference from this entry.longgetWriteTime()voidsetAccessTime(long time)Sets the entry access time in ns.voidsetNextInAccessQueue(ReferenceEntry<K,V> next)Sets the next entry in the access queue.voidsetNextInWriteQueue(ReferenceEntry<K,V> next)Sets the next entry in the write queue.voidsetPreviousInAccessQueue(ReferenceEntry<K,V> previous)Sets the previous entry in the access queue.voidsetPreviousInWriteQueue(ReferenceEntry<K,V> previous)Sets the previous entry in the write queue.voidsetValueReference(LocalCache.ValueReference<K,V> valueReference)Sets the value reference for this entry.voidsetWriteTime(long time)Sets the entry write time in ns.
-
-
-
Field Detail
-
hash
final int hash
-
next
final ReferenceEntry<K,V> next
-
valueReference
volatile LocalCache.ValueReference<K,V> valueReference
-
-
Constructor Detail
-
WeakEntry
WeakEntry(java.lang.ref.ReferenceQueue<K> queue, K key, int hash, ReferenceEntry<K,V> next)
-
-
Method Detail
-
getKey
public K getKey()
Description copied from interface:ReferenceEntryReturns the key for this entry.- Specified by:
getKeyin interfaceReferenceEntry<K,V>
-
getAccessTime
public long getAccessTime()
Description copied from interface:ReferenceEntryReturns the time that this entry was last accessed, in ns.- Specified by:
getAccessTimein interfaceReferenceEntry<K,V>
-
setAccessTime
public void setAccessTime(long time)
Description copied from interface:ReferenceEntrySets the entry access time in ns.- Specified by:
setAccessTimein interfaceReferenceEntry<K,V>
-
getNextInAccessQueue
public ReferenceEntry<K,V> getNextInAccessQueue()
Description copied from interface:ReferenceEntryReturns the next entry in the access queue.- Specified by:
getNextInAccessQueuein interfaceReferenceEntry<K,V>
-
setNextInAccessQueue
public void setNextInAccessQueue(ReferenceEntry<K,V> next)
Description copied from interface:ReferenceEntrySets the next entry in the access queue.- Specified by:
setNextInAccessQueuein interfaceReferenceEntry<K,V>
-
getPreviousInAccessQueue
public ReferenceEntry<K,V> getPreviousInAccessQueue()
Description copied from interface:ReferenceEntryReturns the previous entry in the access queue.- Specified by:
getPreviousInAccessQueuein interfaceReferenceEntry<K,V>
-
setPreviousInAccessQueue
public void setPreviousInAccessQueue(ReferenceEntry<K,V> previous)
Description copied from interface:ReferenceEntrySets the previous entry in the access queue.- Specified by:
setPreviousInAccessQueuein interfaceReferenceEntry<K,V>
-
getWriteTime
public long getWriteTime()
- Specified by:
getWriteTimein interfaceReferenceEntry<K,V>
-
setWriteTime
public void setWriteTime(long time)
Description copied from interface:ReferenceEntrySets the entry write time in ns.- Specified by:
setWriteTimein interfaceReferenceEntry<K,V>
-
getNextInWriteQueue
public ReferenceEntry<K,V> getNextInWriteQueue()
Description copied from interface:ReferenceEntryReturns the next entry in the write queue.- Specified by:
getNextInWriteQueuein interfaceReferenceEntry<K,V>
-
setNextInWriteQueue
public void setNextInWriteQueue(ReferenceEntry<K,V> next)
Description copied from interface:ReferenceEntrySets the next entry in the write queue.- Specified by:
setNextInWriteQueuein interfaceReferenceEntry<K,V>
-
getPreviousInWriteQueue
public ReferenceEntry<K,V> getPreviousInWriteQueue()
Description copied from interface:ReferenceEntryReturns the previous entry in the write queue.- Specified by:
getPreviousInWriteQueuein interfaceReferenceEntry<K,V>
-
setPreviousInWriteQueue
public void setPreviousInWriteQueue(ReferenceEntry<K,V> previous)
Description copied from interface:ReferenceEntrySets the previous entry in the write queue.- Specified by:
setPreviousInWriteQueuein interfaceReferenceEntry<K,V>
-
getValueReference
public LocalCache.ValueReference<K,V> getValueReference()
Description copied from interface:ReferenceEntryReturns the value reference from this entry.- Specified by:
getValueReferencein interfaceReferenceEntry<K,V>
-
setValueReference
public void setValueReference(LocalCache.ValueReference<K,V> valueReference)
Description copied from interface:ReferenceEntrySets the value reference for this entry.- Specified by:
setValueReferencein interfaceReferenceEntry<K,V>
-
getHash
public int getHash()
Description copied from interface:ReferenceEntryReturns the entry's hash.- Specified by:
getHashin interfaceReferenceEntry<K,V>
-
getNext
public ReferenceEntry<K,V> getNext()
Description copied from interface:ReferenceEntryReturns the next entry in the chain.- Specified by:
getNextin interfaceReferenceEntry<K,V>
-
-