Package com.google.common.cache
Interface ReferenceEntry<K,V>
- All Known Implementing Classes:
LocalCache.AbstractReferenceEntry
,LocalCache.NullEntry
,LocalCache.StrongAccessEntry
,LocalCache.StrongAccessWriteEntry
,LocalCache.StrongEntry
,LocalCache.StrongWriteEntry
,LocalCache.WeakAccessEntry
,LocalCache.WeakAccessWriteEntry
,LocalCache.WeakEntry
,LocalCache.WeakWriteEntry
interface ReferenceEntry<K,V>
An entry in a reference map.
Entries in the map can be in the following states:
Valid:
- Live: valid key/value are set
- Loading: loading is pending
Invalid:
- Expired: time expired (key/value may still be set)
- Collected: key/value was partially collected, but not yet cleaned up
- Unset: marked as unset, awaiting cleanup or reuse
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the time that this entry was last accessed, in ns.int
getHash()
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.long
void
setAccessTime
(long time) Sets the entry access time in ns.void
setNextInAccessQueue
(ReferenceEntry<K, V> next) Sets the next entry in the access queue.void
setNextInWriteQueue
(ReferenceEntry<K, V> next) Sets the next entry in the write queue.void
setPreviousInAccessQueue
(ReferenceEntry<K, V> previous) Sets the previous entry in the access queue.void
setPreviousInWriteQueue
(ReferenceEntry<K, V> previous) Sets the previous entry in the write queue.void
setValueReference
(LocalCache.ValueReference<K, V> valueReference) Sets the value reference for this entry.void
setWriteTime
(long time) Sets the entry write time in ns.
-
Method Details
-
getValueReference
Returns the value reference from this entry. -
setValueReference
Sets the value reference for this entry. -
getNext
Returns the next entry in the chain. -
getHash
int getHash()Returns the entry's hash. -
getKey
Returns the key for this entry. -
getAccessTime
long getAccessTime()Returns the time that this entry was last accessed, in ns. -
setAccessTime
void setAccessTime(long time) Sets the entry access time in ns. -
getNextInAccessQueue
ReferenceEntry<K,V> getNextInAccessQueue()Returns the next entry in the access queue. -
setNextInAccessQueue
Sets the next entry in the access queue. -
getPreviousInAccessQueue
ReferenceEntry<K,V> getPreviousInAccessQueue()Returns the previous entry in the access queue. -
setPreviousInAccessQueue
Sets the previous entry in the access queue. -
getWriteTime
long getWriteTime() -
setWriteTime
void setWriteTime(long time) Sets the entry write time in ns. -
getNextInWriteQueue
ReferenceEntry<K,V> getNextInWriteQueue()Returns the next entry in the write queue. -
setNextInWriteQueue
Sets the next entry in the write queue. -
getPreviousInWriteQueue
ReferenceEntry<K,V> getPreviousInWriteQueue()Returns the previous entry in the write queue. -
setPreviousInWriteQueue
Sets the previous entry in the write queue.
-