-
- 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.
-
-
Method Summary
Modifier and Type Method Description abstract <T extends Any> Ttransaction(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
-
-
Method Detail
-
transaction
abstract <T extends Any> T transaction(SuspendFunction1<CacheTransaction<V>, T> block)
Performs an atomic block transaction on this cache.
-
-
-
-