Class FD<K,​V>

    • Constructor Detail

      • FD

        FD()
      • FD

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

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

      • getKeyReference

        public final java.lang.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>
      • getKey

        public final 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>
      • getValue

        public final 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 final java.lang.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 final void setValue​(V value,
                                   java.lang.ref.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 final boolean containsValue​(java.lang.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>
      • newNode

        public Node<K,​V> newNode​(K key,
                                       java.lang.ref.ReferenceQueue<K> keyReferenceQueue,
                                       V value,
                                       java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
                                       int weight,
                                       long now)
        Description copied from interface: NodeFactory
        Returns a node optimized for the specified features.
        Specified by:
        newNode in interface NodeFactory<K,​V>
      • newNode

        public Node<K,​V> newNode​(java.lang.Object keyReference,
                                       V value,
                                       java.lang.ref.ReferenceQueue<V> valueReferenceQueue,
                                       int weight,
                                       long now)
        Description copied from interface: NodeFactory
        Returns a node optimized for the specified features.
        Specified by:
        newNode in interface NodeFactory<K,​V>
      • newLookupKey

        public java.lang.Object newLookupKey​(java.lang.Object key)
        Description copied from interface: NodeFactory
        Returns 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 a References.LookupKeyReference holding the key argument is returned.
        Specified by:
        newLookupKey in interface NodeFactory<K,​V>
      • newReferenceKey

        public java.lang.Object newReferenceKey​(K key,
                                                java.lang.ref.ReferenceQueue<K> referenceQueue)
        Description copied from interface: NodeFactory
        Returns 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 a References.WeakKeyReference holding the key argument is returned.
        Specified by:
        newReferenceKey in interface NodeFactory<K,​V>
      • softValues

        public boolean softValues()
        Description copied from interface: NodeFactory
        Returns whether this factory supports soft values.
        Specified by:
        softValues in interface NodeFactory<K,​V>
      • isAlive

        public final 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 final 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>
      • retire

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

        public final 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>
      • die

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