Class NodeFactory.SW<K,​V>

    • Field Detail

      • KEY_OFFSET

        protected static final long KEY_OFFSET
      • VALUE_OFFSET

        protected static final long VALUE_OFFSET
      • key

        private volatile K key
    • Constructor Detail

      • SW

        SW​(K key,
           java.lang.ref.ReferenceQueue<K> keyReferenceQueue,
           V value,
           java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
           int weight,
           long now)
      • SW

        SW​(java.lang.Object keyReference,
           V value,
           java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
           int weight,
           long now)
    • Method Detail

      • getKey

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

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

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

        public final java.lang.Object getValueReference()
        Description copied from interface: 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 interface Node<K,​V>
      • setValue

        public final void setValue​(V value,
                                   java.lang.ref.ReferenceQueue<V> referenceQueue)
        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.
        Specified by:
        setValue in interface Node<K,​V>
      • containsValue

        public final boolean containsValue​(java.lang.Object value)
        Description copied from interface: 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 interface Node<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.
        Specified by:
        isAlive in interface Node<K,​V>
      • 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.
        Specified by:
        isRetired in interface Node<K,​V>
      • retire

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

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

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

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object