Key - type of keyData - type of cached datapublic class SimpleCache<Key,Data> extends Object implements IMemoryManageable, Closeable
IMemoryManageable.FreeMemoryLevel| Constructor and Description |
|---|
SimpleCache(String description,
Function<Key,Data> provider)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
freeMemory(IMemoryManageable.FreeMemoryLevel level)
Request to free some memory.
|
Data |
get(Key key)
Get a data, or create it using the provider.
|
String |
getDescription()
Desciption.
|
List<String> |
getItemsDescription()
Describe each item that can be freed.
|
void |
remove(Key key)
Remove the cached data associated with the given key.
|
public void close()
close in interface Closeableclose in interface AutoCloseablepublic void remove(Key key)
public String getDescription()
IMemoryManageablegetDescription in interface IMemoryManageablepublic List<String> getItemsDescription()
IMemoryManageablegetItemsDescription in interface IMemoryManageablepublic void freeMemory(IMemoryManageable.FreeMemoryLevel level)
IMemoryManageablefreeMemory in interface IMemoryManageableCopyright © 2019. All rights reserved.