K - the type of keys maintained by this mapV - the type of mapped valuespublic class MaxSizeLinkedHashMap<K,V> extends LinkedHashMap<K,V>
LinkedHashMap with a maximum size. Adding an Entry that would exceed this size
results in removing the eldest entry.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
MaxSizeLinkedHashMap(int maxSize)
Constructs a MaxSizeLinkedHashMap with maximum size
maxSize. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic MaxSizeLinkedHashMap(int maxSize)
maxSize.maxSize - The maximum size for this MaxSizeLinkedHashMap.IllegalArgumentException - if maxSize is not positive.protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
This implementation will return true if this MaxSizeLinkedHashMap has reached its maximum size, else false.
removeEldestEntry in class LinkedHashMap<K,V>Copyright © 2006–2017 Icegreen Technologies. All rights reserved.