Class PDW<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.Node<K,V>
com.github.benmanes.caffeine.cache.PD<K,V>
com.github.benmanes.caffeine.cache.PDW<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:
- ExpireWrite
- StrongKeys (inherited)
- SoftValues (inherited)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final long(package private) longFields inherited from class PD
value, VALUE_OFFSETFields inherited from interface NodeFactory
DEAD_STRONG_KEY, DEAD_WEAK_KEY, RETIRED_STRONG_KEY, RETIRED_WEAK_KEY -
Constructor Summary
ConstructorsConstructorDescriptionPDW()PDW(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) PDW(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
Method Summary
Modifier and TypeMethodDescriptionbooleancasVariableTime(long expect, long update) Atomically sets the variable time to the given updated value if the current value equals the expected value and returns if the update was successful.Retrieves the next element or null if either the element is unlinked or the last element on the deque.Retrieves the previous element or null if either the element is unlinked or the first element on the deque.longReturns the variable expiration time, in nanoseconds.final longReturns the time that this entry was last written, in ns.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.voidsetNextInVariableOrder(Node<K, V> nextInWriteOrder) final voidsetNextInWriteOrder(Node<K, V> nextInWriteOrder) Sets the next element or null if there is no link.voidsetPreviousInVariableOrder(Node<K, V> previousInWriteOrder) final voidsetPreviousInWriteOrder(Node<K, V> previousInWriteOrder) Sets the previous element or null if there is no link.voidsetVariableTime(long writeTime) Sets the variable expiration time in nanoseconds.final voidsetWriteTime(long writeTime) Sets the write time in nanoseconds.Methods inherited from class PD
containsValue, die, getKey, getKeyReference, getValue, getValueReference, isAlive, isDead, isRetired, retire, setValue, softValuesMethods inherited from class Node
casWriteTime, getAccessTime, getNextInAccessOrder, getPolicyWeight, getPreviousInAccessOrder, getQueueType, getWeight, inMainProbation, inMainProtected, inWindow, makeMainProbation, makeMainProtected, makeWindow, setAccessTime, setNextInAccessOrder, setPolicyWeight, setPreviousInAccessOrder, setQueueType, setWeight, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface NodeFactory
newLookupKey, newReferenceKey, weakValues
-
Field Details
-
WRITE_TIME_OFFSET
protected static final long WRITE_TIME_OFFSET -
writeTime
volatile long writeTime -
previousInWriteOrder
-
nextInWriteOrder
-
-
Constructor Details
-
PDW
PDW() -
PDW
PDW(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
PDW
PDW(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now)
-
-
Method Details
-
getPreviousInVariableOrder
-
setPreviousInVariableOrder
-
getNextInVariableOrder
-
setNextInVariableOrder
-
getVariableTime
public long getVariableTime()Description copied from class:NodeReturns the variable expiration time, in nanoseconds.- Overrides:
getVariableTimein classNode<K,V>
-
setVariableTime
public void setVariableTime(long writeTime) Description copied from class:NodeSets the variable expiration time in nanoseconds. This update may be set lazily and rely on the memory fence when the lock is released.- Overrides:
setVariableTimein classNode<K,V>
-
casVariableTime
public boolean casVariableTime(long expect, long update) Description copied from class:NodeAtomically sets the variable time to the given updated value if the current value equals the expected value and returns if the update was successful.- Overrides:
casVariableTimein classNode<K,V>
-
getWriteTime
public final long getWriteTime()Description copied from class:NodeReturns the time that this entry was last written, in ns.- Overrides:
getWriteTimein classNode<K,V>
-
setWriteTime
public final void setWriteTime(long writeTime) Description copied from class:NodeSets the write time in nanoseconds. This update may be set lazily and rely on the memory fence when the lock is released.- Overrides:
setWriteTimein classNode<K,V>
-
getPreviousInWriteOrder
Description copied from interface:WriteOrderDeque.WriteOrderRetrieves the previous element or null if either the element is unlinked or the first element on the deque.- Specified by:
getPreviousInWriteOrderin interfaceWriteOrderDeque.WriteOrder<K>- Overrides:
getPreviousInWriteOrderin classNode<K,V>
-
setPreviousInWriteOrder
Description copied from interface:WriteOrderDeque.WriteOrderSets the previous element or null if there is no link.- Specified by:
setPreviousInWriteOrderin interfaceWriteOrderDeque.WriteOrder<K>- Overrides:
setPreviousInWriteOrderin classNode<K,V>
-
getNextInWriteOrder
Description copied from interface:WriteOrderDeque.WriteOrderRetrieves the next element or null if either the element is unlinked or the last element on the deque.- Specified by:
getNextInWriteOrderin interfaceWriteOrderDeque.WriteOrder<K>- Overrides:
getNextInWriteOrderin classNode<K,V>
-
setNextInWriteOrder
Description copied from interface:WriteOrderDeque.WriteOrderSets the next element or null if there is no link.- Specified by:
setNextInWriteOrderin interfaceWriteOrderDeque.WriteOrder<K>- Overrides:
setNextInWriteOrderin 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:NodeFactoryReturns a node optimized for the specified features. -
newNode
public Node<K,V> newNode(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) Description copied from interface:NodeFactoryReturns a node optimized for the specified features.
-