Class DynamicLruCache<T,V>
java.lang.Object
androidx.collection.LruCache<T,V>
com.pranavpandey.android.dynamic.util.cache.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
An
LruCache
to provide base for the other caches.-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default byte multiplier for this cache.static final int
Default maximum size for this cache. -
Constructor Summary
ConstructorDescriptionConstructor to initialize an object of this class.DynamicLruCache
(int maxSize, int byteMultiplier) Constructor to initialize an object of this class. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the byte multiplier for this cache.int
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
-
Field Details
-
MAX_SIZE
public static final int MAX_SIZEDefault maximum size for this cache.- See Also:
-
BYTE_MULTIPLIER
public static final int BYTE_MULTIPLIERDefault byte multiplier for this cache.- See Also:
-
-
Constructor Details
-
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 Details
-
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.
-