Package 

Interface Cache

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

    
    public interface Cache<V extends Object>
     implements SuspendingCloseable, MemoryObserver
                        

    A generic cache for objects of type V.

    It implements MemoryObserver to flush unused in-memory objects when necessary.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract <T extends Any> T transaction(SuspendFunction1<CacheTransaction<V>, T> block) Performs an atomic block transaction on this cache.
      • Methods inherited from class org.readium.r2.shared.util.SuspendingCloseable

        close
      • Methods inherited from class org.readium.r2.shared.util.MemoryObserver

        onTrimMemory
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait