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>
Used for weakly-referenced keys.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int(package private) final ReferenceEntry<K,V> (package private) LocalCache.ValueReference<K,V> -
Constructor Summary
ConstructorsConstructorDescriptionWeakEntry(ReferenceQueue<K> queue, K key, int hash, ReferenceEntry<K, V> next) -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the time that this entry was last accessed, in ns.intgetHash()Returns the entry's hash.getKey()Returns the key for this entry.getNext()Returns the next entry in the chain.Returns the next entry in the access queue.Returns the next entry in the write queue.Returns the previous entry in the access queue.Returns the previous entry in the write queue.Returns the value reference from this entry.longvoidsetAccessTime(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.Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence, refersTo
-
Field Details
-
hash
final int hash -
next
-
valueReference
-
-
Constructor Details
-
WeakEntry
WeakEntry(ReferenceQueue<K> queue, K key, int hash, ReferenceEntry<K, V> next)
-
-
Method Details
-
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
Description copied from interface:ReferenceEntryReturns the next entry in the access queue.- Specified by:
getNextInAccessQueuein interfaceReferenceEntry<K,V>
-
setNextInAccessQueue
Description copied from interface:ReferenceEntrySets the next entry in the access queue.- Specified by:
setNextInAccessQueuein interfaceReferenceEntry<K,V>
-
getPreviousInAccessQueue
Description copied from interface:ReferenceEntryReturns the previous entry in the access queue.- Specified by:
getPreviousInAccessQueuein interfaceReferenceEntry<K,V>
-
setPreviousInAccessQueue
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
Description copied from interface:ReferenceEntryReturns the next entry in the write queue.- Specified by:
getNextInWriteQueuein interfaceReferenceEntry<K,V>
-
setNextInWriteQueue
Description copied from interface:ReferenceEntrySets the next entry in the write queue.- Specified by:
setNextInWriteQueuein interfaceReferenceEntry<K,V>
-
getPreviousInWriteQueue
Description copied from interface:ReferenceEntryReturns the previous entry in the write queue.- Specified by:
getPreviousInWriteQueuein interfaceReferenceEntry<K,V>
-
setPreviousInWriteQueue
Description copied from interface:ReferenceEntrySets the previous entry in the write queue.- Specified by:
setPreviousInWriteQueuein interfaceReferenceEntry<K,V>
-
getValueReference
Description copied from interface:ReferenceEntryReturns the value reference from this entry.- Specified by:
getValueReferencein interfaceReferenceEntry<K,V>
-
setValueReference
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
Description copied from interface:ReferenceEntryReturns the next entry in the chain.- Specified by:
getNextin interfaceReferenceEntry<K,V>
-