-
public final class MemoryCache.Builder
-
-
Constructor Summary
Constructors Constructor Description MemoryCache.Builder(Context context)
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>maxSizePercent(@FloatRange(from = 0.0.toDouble(), to = 1.0.toDouble()) Double percent)Set the maximum size of the memory cache as a percentage of this application's available memory. final <ERROR CLASS>maxSizeBytes(Integer size)Set the maximum size of the memory cache in bytes. final <ERROR CLASS>strongReferencesEnabled(Boolean enable)Enables/disables strong reference tracking of values added to this memory cache. final <ERROR CLASS>weakReferencesEnabled(Boolean enable)Enables/disables weak reference tracking of values added to this memory cache. final MemoryCachebuild()Create a new MemoryCache instance. -
-
Constructor Detail
-
MemoryCache.Builder
MemoryCache.Builder(Context context)
-
-
Method Detail
-
maxSizePercent
final <ERROR CLASS> maxSizePercent(@FloatRange(from = 0.0.toDouble(), to = 1.0.toDouble()) Double percent)
Set the maximum size of the memory cache as a percentage of this application's available memory.
-
maxSizeBytes
final <ERROR CLASS> maxSizeBytes(Integer size)
Set the maximum size of the memory cache in bytes.
-
strongReferencesEnabled
final <ERROR CLASS> strongReferencesEnabled(Boolean enable)
Enables/disables strong reference tracking of values added to this memory cache.
-
weakReferencesEnabled
final <ERROR CLASS> weakReferencesEnabled(Boolean enable)
Enables/disables weak reference tracking of values added to this memory cache. Weak references do not contribute to the current size of the memory cache. This ensures that if a Bitmap hasn't been garbage collected yet it will be returned from the memory cache.
-
build
final MemoryCache build()
Create a new MemoryCache instance.
-
-
-
-