Package 

Class InMemoryCache

  • All Implemented Interfaces:
    org.readium.r2.shared.util.MemoryObserver , org.readium.r2.shared.util.SuspendingCloseable , org.readium.r2.shared.util.cache.Cache

    
    public final class InMemoryCache<V extends Object>
     implements Cache<V>
                        

    A basic in-memory cache.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      InMemoryCache()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      <T extends Any> T transaction(SuspendFunction1<CacheTransaction<V>, T> block) Performs an atomic block transaction on this cache.
      Unit close() Closes this object and releases any resources associated with it.
      Unit onTrimMemory(MemoryObserver.Level level) Called by the system when memory needs to be freed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InMemoryCache

        InMemoryCache()