Class NodeFactory.SSt<K,V>
java.lang.Object
com.github.benmanes.caffeine.cache.NodeFactory.SSt<K,V>
- All Implemented Interfaces:
AccessOrderDeque.AccessOrder<Node<K,
,V>> Node<K,
,V> WriteOrderDeque.WriteOrder<Node<K,
V>>
- Direct Known Subclasses:
NodeFactory.SStA
,NodeFactory.SStMS
,NodeFactory.SStMW
,NodeFactory.SStR
,NodeFactory.SStW
- Enclosing class:
- NodeFactory
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSSt
(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) SSt
(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.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.final String
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.Node
casWriteTime, getAccessTime, getNextInAccessOrder, getNextInWriteOrder, getPolicyWeight, getPreviousInAccessOrder, getPreviousInWriteOrder, getQueueType, getWeight, getWriteTime, inEden, inMainProbation, inMainProtected, makeMainProbation, makeMainProtected, setAccessTime, setNextInAccessOrder, setNextInWriteOrder, setPolicyWeight, setPreviousInAccessOrder, setPreviousInWriteOrder, setQueueType, setWeight, setWriteTime
-
Field Details
-
KEY_OFFSET
protected static final long KEY_OFFSET -
VALUE_OFFSET
protected static final long VALUE_OFFSET -
key
-
value
-
-
Constructor Details
-
SSt
SSt(K key, ReferenceQueue<K> keyReferenceQueue, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now) -
SSt
SSt(Object keyReference, V value, ReferenceQueue<V> valueReferenceQueue, int weight, long now)
-
-
Method Details
-
getKey
Description copied from interface:Node
Return the key ornull
if it has been reclaimed by the garbage collector. -
getKeyReference
Description copied from interface: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 interfaceNode<K,
V>
-
getValue
Description copied from interface:Node
Return the value ornull
if it has been reclaimed by the garbage collector. -
getValueReference
Description copied from interface:Node
Returns the reference to the value. This is either the value if strongly held or aReference
to that value.- Specified by:
getValueReference
in interfaceNode<K,
V>
-
setValue
Description copied from interface: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 interface: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 interfaceNode<K,
V>
-
isAlive
public final boolean isAlive()Description copied from interface:Node
If the entry is available in the hash-table and page replacement policy. -
isRetired
public final boolean isRetired()Description copied from interface: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 interface:Node
Sets the node to the retired state. -
isDead
public final boolean isDead()Description copied from interface:Node
If the entry was removed from the hash-table and the page replacement policy. -
die
public final void die()Description copied from interface:Node
Sets the node to the dead state. -
toString
-