Class DynamicLruCache<T,​V>

  • Type Parameters:
    T - The type of the key for this cache.
    V - The type of the value for this cache.
    Direct Known Subclasses:
    BitmapLruCache, DrawableLruCache, IntegerLruCache

    public abstract class DynamicLruCache<T,​V>
    extends androidx.collection.LruCache<T,​V>
    An LruCache to provide base for the other caches.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BYTE_MULTIPLIER
      Default byte multiplier for this cache.
      static int MAX_SIZE
      Default maximum size for this cache.
    • Constructor Summary

      Constructors 
      Constructor Description
      DynamicLruCache()
      Constructor to initialize an object of this class.
      DynamicLruCache​(int maxSize, int byteMultiplier)
      Constructor to initialize an object of this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getByteMultiplier()
      Returns the byte multiplier for this cache.
      int getMaxSize()
      Returns the maximum size for this cache.
      • Methods inherited from class androidx.collection.LruCache

        create, createCount, entryRemoved, evictAll, evictionCount, get, hitCount, maxSize, missCount, put, putCount, remove, resize, size, sizeOf, snapshot, toString, trimToSize
      • Methods inherited from class java.lang.Object

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

      • MAX_SIZE

        public static final int MAX_SIZE
        Default maximum size for this cache.
        See Also:
        Constant Field Values
      • BYTE_MULTIPLIER

        public static final int BYTE_MULTIPLIER
        Default byte multiplier for this cache.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DynamicLruCache

        public DynamicLruCache()
        Constructor to initialize an object of this class.
      • DynamicLruCache

        public DynamicLruCache​(int maxSize,
                               int byteMultiplier)
        Constructor to initialize an object of this class.
        Parameters:
        maxSize - The maximum size to be used.
        byteMultiplier - The byte multiplier to be used.
    • Method Detail

      • getMaxSize

        public int getMaxSize()
        Returns the maximum size for this cache.
        Returns:
        The maximum size for this cache.
      • getByteMultiplier

        public int getByteMultiplier()
        Returns the byte multiplier for this cache.
        Returns:
        The byte multiplier for this cache.