Class FS<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.Node<K,V>
com.github.benmanes.caffeine.cache.FS<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
- StrongValues
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) References.WeakKeyReference<K> protected static final long(package private) Vprotected static final longFields inherited from interface NodeFactory
DEAD_STRONG_KEY, DEAD_WEAK_KEY, RETIRED_STRONG_KEY, RETIRED_WEAK_KEY -
Constructor Summary
ConstructorsConstructorDescriptionFS()FS(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) FS(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancontainsValue(Object value) Returnstrueif the given objects are considered equivalent.final voiddie()Sets the node to the dead state.final KgetKey()Return the key ornullif it has been reclaimed by the garbage collector.final ObjectReturns the reference that the cache is holding the entry by.final VgetValue()Return the value ornullif it has been reclaimed by the garbage collector.final ObjectReturns the reference to the value.final booleanisAlive()If the entry is available in the hash-table and page replacement policy.final booleanisDead()If the entry was removed from the hash-table and the page replacement policy.final booleanIf 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 voidretire()Sets the node to the retired state.final voidsetValue(V value, ReferenceQueue<V> referenceQueue) Sets the value, which may be held strongly, weakly, or softly.Methods inherited from class 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, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface NodeFactory
softValues, weakValues
-
Field Details
-
KEY_OFFSET
protected static final long KEY_OFFSET -
VALUE_OFFSET
protected static final long VALUE_OFFSET -
key
-
value
-
-
Constructor Details
-
FS
FS() -
FS
FS(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
FS
FS(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now)
-
-
Method Details
-
getKey
-
getKeyReference
Description copied from class:NodeReturns the reference that the cache is holding the entry by. This is either the key if strongly held or aWeakReferenceto that key.- Specified by:
getKeyReferencein classNode<K,V>
-
getValue
-
getValueReference
-
setValue
-
containsValue
-
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.- Specified by:
newNodein interfaceNodeFactory<K,V>
-
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.- Specified by:
newNodein interfaceNodeFactory<K,V>
-
newLookupKey
Description copied from interface:NodeFactoryReturns 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.LookupKeyReferenceholding the key argument is returned.- Specified by:
newLookupKeyin interfaceNodeFactory<K,V>
-
newReferenceKey
Description copied from interface:NodeFactoryReturns 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:
newReferenceKeyin interfaceNodeFactory<K,V>
-
isAlive
-
isRetired
-
retire
-
isDead
-
die
-