Interface IntrusiveSoftLRU.Adapter<T>

Type Parameters:
T -
All Known Implementing Classes:
IntrusiveSoftLRU.Node.Adapter
Enclosing class:
IntrusiveSoftLRU<T>

public static interface IntrusiveSoftLRU.Adapter<T>
An interface defining the required intrusive property getters and setters. Users should not directly call these methods, or they risk corrupting the internal data structure.
  • Method Summary

    Modifier and Type
    Method
    Description
    getOwner(T cachedObject)
    Get a SoftReference object which refers to the object being cached and will act as its "owner" in the cache.
    int
    getSlot(T cachedObject)
    Get the slot in which the object is stored in the cache.
    void
    setSlot(T cachedObject, int slot)
    Set the slot in which the reference is stored in the cache.
  • Method Details

    • getOwner

      SoftReference<T> getOwner(T cachedObject)
      Get a SoftReference object which refers to the object being cached and will act as its "owner" in the cache.
      Parameters:
      cachedObject - the object being cached.
      Returns:
      a SoftReference that refers to the item and will act as its "owner" in the cache.
    • getSlot

      int getSlot(T cachedObject)
      Get the slot in which the object is stored in the cache.
      Parameters:
      cachedObject - the being cached.
      Returns:
      the slot for the object.
    • setSlot

      void setSlot(T cachedObject, int slot)
      Set the slot in which the reference is stored in the cache.
      Parameters:
      cachedObject - the object being cached.
      slot - the slot where it will be stored.