Class TimerWheel.Sentinel<K,V>

java.lang.Object
com.github.benmanes.caffeine.cache.Node<K,V>
com.github.benmanes.caffeine.cache.TimerWheel.Sentinel<K,V>
All Implemented Interfaces:
AccessOrderDeque.AccessOrder<Node<K,V>>, WriteOrderDeque.WriteOrder<Node<K,V>>
Enclosing class:
TimerWheel<K,V>

static final class TimerWheel.Sentinel<K,V> extends Node<K,V>
A sentinel for the doubly-linked list in the bucket.
  • Field Details

  • Constructor Details

    • Sentinel

      Sentinel()
  • Method Details

    • getPreviousInVariableOrder

      public Node<K,V> getPreviousInVariableOrder()
      Overrides:
      getPreviousInVariableOrder in class Node<K,V>
    • setPreviousInVariableOrder

      public void setPreviousInVariableOrder(@Nullable Node<K,V> prev)
      Overrides:
      setPreviousInVariableOrder in class Node<K,V>
    • getNextInVariableOrder

      public Node<K,V> getNextInVariableOrder()
      Overrides:
      getNextInVariableOrder in class Node<K,V>
    • setNextInVariableOrder

      public void setNextInVariableOrder(@Nullable Node<K,V> next)
      Overrides:
      setNextInVariableOrder in class Node<K,V>
    • getKey

      public @Nullable K getKey()
      Description copied from class: Node
      Return the key or null if it has been reclaimed by the garbage collector.
      Specified by:
      getKey in class Node<K,V>
    • getKeyReference

      public Object 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 a WeakReference to that key.
      Specified by:
      getKeyReference in class Node<K,V>
    • getValue

      public @Nullable V getValue()
      Description copied from class: Node
      Return the value or null if it has been reclaimed by the garbage collector.
      Specified by:
      getValue in class Node<K,V>
    • getValueReference

      public Object getValueReference()
      Description copied from class: Node
      Returns the reference to the value. This is either the value if strongly held or a Reference to that value.
      Specified by:
      getValueReference in class Node<K,V>
    • setValue

      public void setValue(V value, @Nullable ReferenceQueue<V> referenceQueue)
      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.
      Specified by:
      setValue in class Node<K,V>
    • containsValue

      public boolean containsValue(Object value)
      Description copied from class: Node
      Returns true 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 class Node<K,V>
    • isAlive

      public boolean isAlive()
      Description copied from class: Node
      If the entry is available in the hash-table and page replacement policy.
      Specified by:
      isAlive in class Node<K,V>
    • isRetired

      public 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.
      Specified by:
      isRetired in class Node<K,V>
    • isDead

      public boolean isDead()
      Description copied from class: Node
      If the entry was removed from the hash-table and the page replacement policy.
      Specified by:
      isDead in class Node<K,V>
    • retire

      public void retire()
      Description copied from class: Node
      Sets the node to the retired state.
      Specified by:
      retire in class Node<K,V>
    • die

      public void die()
      Description copied from class: Node
      Sets the node to the dead state.
      Specified by:
      die in class Node<K,V>