Interface EvictableCache<K,V>
- Type Parameters:
- K- type of the keys
- V- type of the values
- All Superinterfaces:
- java.util.Map<K,V>,- MemoizeCache<K,V>
- All Known Implementing Classes:
- CommonCache,- ConcurrentCommonCache,- ConcurrentSoftCache,- StampedCommonCache,- UnlimitedConcurrentCache
public interface EvictableCache<K,V> extends MemoizeCache<K,V>, java.util.Map<K,V>
Represents an evictable memoize cache with its essential methods
- Since:
- 2.5.0
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfaceEvictableCache.Action<K,V,R>Represents the action to deal with the cachestatic classEvictableCache.EvictionStrategyRepresents a eviction strategy for the cache with limited sizeNested classes/interfaces inherited from interface java.util.Mapjava.util.Map.Entry<K extends java.lang.Object,V extends java.lang.Object>Nested classes/interfaces inherited from interface org.codehaus.groovy.runtime.memoize.MemoizeCacheMemoizeCache.ValueProvider<K,V>
- 
Method SummaryModifier and Type Method Description default voidclear()Clear the cachejava.util.Map<K,V>clearAll()Clear the cachebooleancontainsKey(java.lang.Object key)Determines if the cache contains an entry for the specified key.java.util.Set<K>keys()Get all keys associated to cached valuesVremove(java.lang.Object key)Remove the cached value by the keyintsize()Get the size of the cachejava.util.Collection<V>values()Get all cached valuesMethods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface org.codehaus.groovy.runtime.memoize.MemoizeCachecleanUpNullReferences, get, getAndPut, put
- 
Method Details- 
removeRemove the cached value by the key
- 
clearAllClear the cache- Returns:
- returns the content of the cleared map
 
- 
cleardefault void clear()Clear the cache- Specified by:
- clearin interface- java.util.Map<K,V>
- See Also:
- clearAll()
 
- 
valuesjava.util.Collection<V> values()Get all cached values
- 
keysjava.util.Set<K> keys()Get all keys associated to cached values- Returns:
- all keys
 
- 
containsKeyboolean containsKey(java.lang.Object key)Determines if the cache contains an entry for the specified key.
- 
sizeint size()Get the size of the cache
 
-