Class LruCache.Entry<K,V>

java.lang.Object
org.eclipse.handly.util.LruCache.Entry<K,V>
Enclosing class:
LruCache<K,V>

protected static class LruCache.Entry<K,V> extends Object
An LRU cache entry. Entries are ordered in the cache from most recently accessed to least recently accessed.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final K
    The key of this entry (never null).
    The value of this entry (never null).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Entry(K key, V value)
    Constructs a cache entry with the given key and value.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the cache entry that immediately follows this entry, or null if this is the LRU entry.
    Returns the cache entry that is immediately followed by this entry, or null if this is the MRU entry.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • key

      public final K key
      The key of this entry (never null).
    • value

      public V value
      The value of this entry (never null).
  • Constructor Details

    • Entry

      public Entry(K key, V value)
      Constructs a cache entry with the given key and value.
      Parameters:
      key - the key of the entry (never null)
      value - the value of the entry (never null)
  • Method Details

    • prev

      public final LruCache.Entry<K,V> prev()
      Returns the cache entry that is immediately followed by this entry, or null if this is the MRU entry.
      Returns:
      the cache entry that is immediately followed by this entry, or null if this is the MRU entry
    • next

      public final LruCache.Entry<K,V> next()
      Returns the cache entry that immediately follows this entry, or null if this is the LRU entry.
      Returns:
      the cache entry that immediately follows this entry, or null if this is the LRU entry
    • toString

      public String toString()
      Overrides:
      toString in class Object