Class FWAR<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.Node<K,V>
com.github.benmanes.caffeine.cache.FW<K,V>
com.github.benmanes.caffeine.cache.FWA<K,V>
com.github.benmanes.caffeine.cache.FWAR<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:
- RefreshWrite
- WeakKeys (inherited)
- WeakValues (inherited)
- ExpireAccess (inherited)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final long(package private) longFields inherited from class FWA
ACCESS_TIME_OFFSET, accessTime, nextInAccessOrder, previousInAccessOrderFields inherited from class FW
value, VALUE_OFFSETFields inherited from interface NodeFactory
DEAD_STRONG_KEY, DEAD_WEAK_KEY, RETIRED_STRONG_KEY, RETIRED_WEAK_KEY -
Constructor Summary
ConstructorsConstructorDescriptionFWAR()FWAR(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) FWAR(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancasWriteTime(long expect, long update) Atomically sets the write time to the given updated value if the current value equals the expected value and returns if the update was successful.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.final voidsetWriteTime(long writeTime) Sets the write time in nanoseconds.Methods inherited from class FWA
casVariableTime, getAccessTime, getNextInAccessOrder, getNextInVariableOrder, getPreviousInAccessOrder, getPreviousInVariableOrder, getVariableTime, setAccessTime, setNextInAccessOrder, setNextInVariableOrder, setPreviousInAccessOrder, setPreviousInVariableOrder, setVariableTimeMethods inherited from class FW
containsValue, die, getKey, getKeyReference, getValue, getValueReference, isAlive, isDead, isRetired, newLookupKey, newReferenceKey, retire, setValue, weakValuesMethods inherited from class Node
getNextInWriteOrder, getPolicyWeight, getPreviousInWriteOrder, getQueueType, getWeight, inMainProbation, inMainProtected, inWindow, makeMainProbation, makeMainProtected, makeWindow, setNextInWriteOrder, setPolicyWeight, setPreviousInWriteOrder, setQueueType, setWeight, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface NodeFactory
softValues
-
Field Details
-
WRITE_TIME_OFFSET
protected static final long WRITE_TIME_OFFSET -
writeTime
volatile long writeTime
-
-
Constructor Details
-
FWAR
FWAR() -
FWAR
FWAR(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
FWAR
FWAR(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now)
-
-
Method Details
-
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>
-
casWriteTime
public final boolean casWriteTime(long expect, long update) Description copied from class:NodeAtomically sets the write time to the given updated value if the current value equals the expected value and returns if the update was successful.- Overrides:
casWriteTimein 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.
-