K - 键类型V - 值类型public class FixedLinkedHashMap<K,V> extends LinkedHashMap<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| 构造器和说明 |
|---|
FixedLinkedHashMap(int capacity)
构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getCapacity()
获取容量
|
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
void |
setCapacity(int capacity)
设置容量
|
void |
setRemoveListener(Consumer<Map.Entry<K,V>> removeListener)
设置自定义移除监听
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic int getCapacity()
public void setCapacity(int capacity)
capacity - 容量public void setRemoveListener(Consumer<Map.Entry<K,V>> removeListener)
removeListener - 移除监听protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry 在类中 LinkedHashMap<K,V>Copyright © 2024. All rights reserved.