Class FD<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.Node<K,V>
com.github.benmanes.caffeine.cache.FD<K,V>
- All Implemented Interfaces:
AccessOrderDeque.AccessOrder<Node<K,
,V>> NodeFactory<K,
,V> WriteOrderDeque.WriteOrder<Node<K,
V>>
WARNING: GENERATED CODE
A cache entry that provides the following features:
- WeakKeys
- SoftValues
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) References.SoftValueReference
<V> protected static final long
Fields inherited from interface com.github.benmanes.caffeine.cache.NodeFactory
DEAD_STRONG_KEY, DEAD_WEAK_KEY, RETIRED_STRONG_KEY, RETIRED_WEAK_KEY
-
Constructor Summary
ConstructorsConstructorDescriptionFD()
FD
(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) FD
(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
containsValue
(Object value) Returnstrue
if the given objects are considered equivalent.final void
die()
Sets the node to the dead state.final K
getKey()
Return the key ornull
if it has been reclaimed by the garbage collector.final Object
Returns the reference that the cache is holding the entry by.final V
getValue()
Return the value ornull
if it has been reclaimed by the garbage collector.final Object
Returns the reference to the value.final boolean
isAlive()
If the entry is available in the hash-table and page replacement policy.final boolean
isDead()
If the entry was removed from the hash-table and the page replacement policy.final boolean
If the entry was removed from the hash-table and is awaiting removal from the page replacement policy.newLookupKey
(Object key) Returns a key suitable for looking up an entry in the cache.newNode
(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) Returns a node optimized for the specified features.newNode
(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) Returns a node optimized for the specified features.newReferenceKey
(K key, ReferenceQueue<K> referenceQueue) Returns a key suitable for inserting into the cache.final void
retire()
Sets the node to the retired state.final void
setValue
(V value, ReferenceQueue<V> referenceQueue) Sets the value, which may be held strongly, weakly, or softly.boolean
Returns whether this factory supports soft values.Methods inherited from class com.github.benmanes.caffeine.cache.Node
casVariableTime, casWriteTime, getAccessTime, getNextInAccessOrder, getNextInVariableOrder, getNextInWriteOrder, getPolicyWeight, getPreviousInAccessOrder, getPreviousInVariableOrder, getPreviousInWriteOrder, getQueueType, getVariableTime, getWeight, getWriteTime, inMainProbation, inMainProtected, inWindow, makeMainProbation, makeMainProtected, makeWindow, setAccessTime, setNextInAccessOrder, setNextInVariableOrder, setNextInWriteOrder, setPolicyWeight, setPreviousInAccessOrder, setPreviousInVariableOrder, setPreviousInWriteOrder, setQueueType, setVariableTime, setWeight, setWriteTime, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.benmanes.caffeine.cache.NodeFactory
weakValues
-
Field Details
-
VALUE_OFFSET
protected static final long VALUE_OFFSET -
value
-
-
Constructor Details
-
FD
FD() -
FD
FD(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
FD
FD(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now)
-
-
Method Details
-
getKeyReference
Description copied from class:Node
Returns the reference that the cache is holding the entry by. This is either the key if strongly held or aWeakReference
to that key.- Specified by:
getKeyReference
in classNode<K,
V>
-
getKey
Description copied from class:Node
Return the key ornull
if it has been reclaimed by the garbage collector. -
getValue
Description copied from class:Node
Return the value ornull
if it has been reclaimed by the garbage collector. -
getValueReference
Description copied from class:Node
Returns the reference to the value. This is either the value if strongly held or aReference
to that value.- Specified by:
getValueReference
in classNode<K,
V>
-
setValue
Description copied from class:Node
Sets the value, which may be held strongly, weakly, or softly. This update may be set lazily and rely on the memory fence when the lock is released. -
containsValue
Description copied from class:Node
Returnstrue
if the given objects are considered equivalent. A strongly held value is compared by equality and a weakly or softly held value is compared by identity.- Specified by:
containsValue
in classNode<K,
V>
-
newNode
public Node<K,V> newNode(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) Description copied from interface:NodeFactory
Returns a node optimized for the specified features.- Specified by:
newNode
in interfaceNodeFactory<K,
V>
-
newNode
public Node<K,V> newNode(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) Description copied from interface:NodeFactory
Returns a node optimized for the specified features.- Specified by:
newNode
in interfaceNodeFactory<K,
V>
-
newLookupKey
Description copied from interface:NodeFactory
Returns a key suitable for looking up an entry in the cache. If the cache holds keys strongly then the key is returned. If the cache holds keys weakly then aReferences.LookupKeyReference
holding the key argument is returned.- Specified by:
newLookupKey
in interfaceNodeFactory<K,
V>
-
newReferenceKey
Description copied from interface:NodeFactory
Returns a key suitable for inserting into the cache. If the cache holds keys strongly then the key is returned. If the cache holds keys weakly then aReferences.WeakKeyReference<K>
holding the key argument is returned.- Specified by:
newReferenceKey
in interfaceNodeFactory<K,
V>
-
softValues
public boolean softValues()Description copied from interface:NodeFactory
Returns whether this factory supports soft values.- Specified by:
softValues
in interfaceNodeFactory<K,
V>
-
isAlive
public final boolean isAlive()Description copied from class:Node
If the entry is available in the hash-table and page replacement policy. -
isRetired
public final boolean isRetired()Description copied from class:Node
If the entry was removed from the hash-table and is awaiting removal from the page replacement policy. -
retire
public final void retire()Description copied from class:Node
Sets the node to the retired state. -
isDead
public final boolean isDead()Description copied from class:Node
If the entry was removed from the hash-table and the page replacement policy. -
die
public final void die()Description copied from class:Node
Sets the node to the dead state.
-