public interface EvictableCache<K, V> extends MemoizeCache, Map
Represents an evictable memoize cache with its essential methods
K
- type of the keysV
- type of the valuesModifiers | Name | Description |
---|---|---|
interface | EvictableCache.Action | Represents the action to deal with the cache |
enum | EvictableCache.EvictionStrategy | Represents a eviction strategy for the cache with limited size |
Type Params | Return Type | Name and description |
---|---|---|
public void |
clear() Clear the cache | |
public Map<K, V> |
clearAll() Clear the cache | |
public boolean |
containsKey(Object key) Determines if the cache contains an entry for the specified key. | |
public Set<K> |
keys() Get all keys associated to cached values | |
public V |
remove(Object key) Remove the cached value by the key | |
public int |
size() Get the size of the cache | |
public Collection<V> |
values() Get all cached values |
Methods inherited from class | Name |
---|---|
interface MemoizeCache | cleanUpNullReferences, get, getAndPut, put |
interface Map | remove, remove, get, put, equals, values, hashCode, copyOf, clear, isEmpty, replace, replace, replaceAll, size, merge, entrySet, putAll, entry, putIfAbsent, compute, of, of, of, of, of, of, of, of, of, of, of, forEach, containsKey, computeIfAbsent, containsValue, keySet, getOrDefault, computeIfPresent, ofEntries |
Clear the cache
Clear the cache
Determines if the cache contains an entry for the specified key.
key
- key whose presence in this cache is to be tested.Get all keys associated to cached values
Remove the cached value by the key
key
- of the cached valueGet the size of the cache
Get all cached values
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/runtime/memoize/EvictableCache.html