Package 

Class MemoryCache.Builder

    • 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 MemoryCache build() Create a new MemoryCache instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.