K
- 键类型V
- 值类型public class FixedLinkedHashMap<K,V> extends LinkedHashMap<K,V>
LinkedHashMap
实现AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
FixedLinkedHashMap(int capacity)
构造
|
Modifier and Type | Method and Description |
---|---|
int |
getCapacity()
获取容量
|
protected boolean |
removeEldestEntry(Map.Entry<K,V> eldest) |
void |
setCapacity(int capacity)
设置容量
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
public FixedLinkedHashMap(int capacity)
capacity
- 容量,实际初始容量比容量大1public int getCapacity()
public void setCapacity(int capacity)
capacity
- 容量protected boolean removeEldestEntry(Map.Entry<K,V> eldest)
removeEldestEntry
in class LinkedHashMap<K,V>
Copyright © 2021. All rights reserved.