Class BoundedLinkedHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
software.amazon.awssdk.utils.internal.BoundedLinkedHashMap<K,V>
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
A bounded linked hash map that would remove the eldest entry when the map size exceeds a configurable maximum.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum size of this map beyond which the eldest entry will get removed.protected booleanremoveEldestEntry(Map.Entry<K, V> eldest) Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesMethods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class java.util.AbstractMap
equals, hashCode, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
Constructor Details
-
BoundedLinkedHashMap
public BoundedLinkedHashMap(int maxSize)
-
-
Method Details
-
removeEldestEntry
Returns true if the size of this map exceeds the maximum.
- Overrides:
removeEldestEntryin classLinkedHashMap<K,V>
-
getMaxSize
public int getMaxSize()Returns the maximum size of this map beyond which the eldest entry will get removed.
-