K - The type of the index of the cache.V - The type of the objects of the cache.public class Cache<K,V>
extends java.util.LinkedHashMap<K,V>
| Modifier and Type | Field and Description |
|---|---|
protected long |
maxSize
The maximum size this cache should have
|
| Constructor and Description |
|---|
Cache(long size)
Constructor, taking the size of the cache as argument.
|
| Modifier and Type | Method and Description |
|---|---|
V |
get(java.lang.Object key) |
protected boolean |
removeEldestEntry(java.util.Map.Entry<K,V> eldest) |
clear, containsValue, entrySet, forEach, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic Cache(long size)
size - public V get(java.lang.Object key)