Interface EvictableCache<K,V>
- Type Parameters:
K
- type of the keysV
- type of the values
- All Superinterfaces:
Map<K,
,V> MemoizeCache<K,
V>
- All Known Implementing Classes:
CommonCache
,ConcurrentCommonCache
,ConcurrentSoftCache
,StampedCommonCache
,UnlimitedConcurrentCache
Represents an evictable memoize cache with its essential methods
- Since:
- 2.5.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents the action to deal with the cachestatic enum
Represents an eviction strategy for the cache with limited sizeNested classes/interfaces inherited from interface java.util.Map
Map.Entry<K extends Object,
V extends Object> Nested classes/interfaces inherited from interface org.codehaus.groovy.runtime.memoize.MemoizeCache
MemoizeCache.ValueProvider<K,
V> -
Method Summary
Modifier and TypeMethodDescriptiondefault void
clear()
Clear the cacheclearAll()
Clear the cacheboolean
containsKey
(Object key) Determines if the cache contains an entry for the specified key.keys()
Get all keys associated to cached valuesRemove the cached value by the keyint
size()
Get the size of the cachevalues()
Get all cached valuesMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, replace, replace, replaceAll
Methods inherited from interface org.codehaus.groovy.runtime.memoize.MemoizeCache
cleanUpNullReferences, get, getAndPut, put
-
Method Details
-
remove
Remove the cached value by the key -
clearAll
Clear the cache- Returns:
- returns the content of the cleared map
-
clear
default void clear()Clear the cache -
values
Collection<V> values()Get all cached values -
keys
Get all keys associated to cached values- Returns:
- all keys
-
containsKey
Determines if the cache contains an entry for the specified key.- Specified by:
containsKey
in interfaceMap<K,
V> - Parameters:
key
- key whose presence in this cache is to be tested.- Returns:
- true if the cache contains a mapping for the specified key
-
size
int size()Get the size of the cache
-