Key - type of keyValue - type of cached datapublic class Cache<Key,Value> extends Object implements CacheManager
CacheManager.CachedData, CacheManager.CachedDataCustomExpirationIMemoryManageable.FreeMemoryLevel| Constructor and Description |
|---|
Cache(String description,
Consumer<Value> freer)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this cache, and free any data it holds.
|
boolean |
free(CacheManager.CachedData data)
Free the given data.
|
void |
free(Value value,
CloseableListenable user)
Signal that the given cached data is not anymore used by the given user.
|
Value |
get(Key key,
CloseableListenable user)
Return the cached data corresponding to the given key, or null if it does not exist.
|
Collection<? extends CacheManager.CachedData> |
getCachedData()
Return this list of cached data.
|
String |
getDescription()
Desciption.
|
List<String> |
getItemsDescription()
Describe each item that can be freed.
|
void |
put(Key key,
Value value,
CloseableListenable firstUser)
Add the given data to this cache, and add the given first user to it.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfreeMemory, getCachedDataExpiration, getDefaultCachedDataExpirationpublic Value get(Key key, CloseableListenable user)
public void free(Value value, CloseableListenable user)
public void put(Key key, Value value, CloseableListenable firstUser)
public Collection<? extends CacheManager.CachedData> getCachedData()
CacheManagergetCachedData in interface CacheManagerpublic boolean free(CacheManager.CachedData data)
CacheManagerfree in interface CacheManagerpublic String getDescription()
IMemoryManageablegetDescription in interface IMemoryManageablepublic List<String> getItemsDescription()
IMemoryManageablegetItemsDescription in interface IMemoryManageablepublic void close()
Copyright © 2019. All rights reserved.