-
- All Implemented Interfaces:
-
org.readium.r2.shared.publication.Publication.Service,org.readium.r2.shared.publication.services.CacheService,org.readium.r2.shared.util.Closeable,org.readium.r2.shared.util.MemoryObserver
public final class InMemoryCacheService implements CacheService, MemoryObserver
A basic CacheService implementation keeping the cached objects in memory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classInMemoryCacheService.Companion
-
Constructor Summary
Constructors Constructor Description InMemoryCacheService(Context context)
-
Method Summary
Modifier and Type Method Description <T extends Any> Cache<T>cacheOf(KClass<T> valueType, String namespace)Gets the cache for objects of valueType in the given namespace. Unitclose()Closes any opened file handles, removes temporary files, etc. UnitonTrimMemory(MemoryObserver.Level level)Called by the system when memory needs to be freed. -
-
Constructor Detail
-
InMemoryCacheService
InMemoryCacheService(Context context)
-
-
Method Detail
-
onTrimMemory
Unit onTrimMemory(MemoryObserver.Level level)
Called by the system when memory needs to be freed.
Release unused resources according to the level.
-
-
-
-