Class CacheLongKeyLIRS.Entry<V>

  • Type Parameters:
    V - the value type
    Enclosing class:
    CacheLongKeyLIRS<V>

    static class CacheLongKeyLIRS.Entry<V>
    extends java.lang.Object
    A cache entry. Each entry is either hot (low inter-reference recency; LIR), cold (high inter-reference recency; HIR), or non-resident-cold. Hot entries are in the stack only. Cold entries are in the queue, and may be in the stack. Non-resident-cold entries have their value set to null and are in the stack and in the non-resident queue.
    • Field Detail

      • key

        final long key
        The key.
      • value

        V value
        The value. Set to null for non-resident-cold entries.
      • reference

        java.lang.ref.WeakReference<V> reference
        Weak reference to the value. Set to null for resident entries.
      • memory

        final int memory
        The estimated memory used.
      • topMove

        int topMove
        When the item was last moved to the top of the stack.
      • queueNext

        CacheLongKeyLIRS.Entry<V> queueNext
        The next entry in the queue (either the resident queue or the non-resident queue).
    • Method Detail

      • isHot

        boolean isHot()
        Whether this entry is hot. Cold entries are in one of the two queues.
        Returns:
        whether the entry is hot
      • getValue

        V getValue()
      • getMemory

        int getMemory()