Package edu.umd.cs.findbugs.util
Class MapCache<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- edu.umd.cs.findbugs.util.MapCache<K,V>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<K,V>
- Direct Known Subclasses:
ProfilingMapCache
public class MapCache<K,V> extends java.util.LinkedHashMap<K,V>
Provide a HashMap that can only grow to a specified maximum capacity, with entries discarded using a LRU policy to keep the size of the HashMap within that bound.- Author:
- pugh
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MapCache(int maxCapacity)
Create a new MapCache
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
removeEldestEntry(java.util.Map.Entry<K,V> eldest)
-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-