Class OrderedMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<K,V>
com.sure.tool.collection.OrderedMap<K,V>
- Type Parameters:
K- key 类型V- value 类型
- All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>, SequencedMap<K, V>
保持插入顺序的 Map 增强,继承
LinkedHashMap,提供首尾元素快捷访问与按索引操作。- Since:
- 0.1.0
- Author:
- suretool
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescription创建空 Map。OrderedMap(int initialCapacity) 创建带初始容量的 Map。OrderedMap(Map<? extends K, ? extends V> map) 从既有 Map 创建。 -
Method Summary
Methods inherited from class LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, newLinkedHashMap, putFirst, putLast, removeEldestEntry, replaceAll, reversed, sequencedEntrySet, sequencedKeySet, sequencedValues, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry
-
Constructor Details
-
OrderedMap
public OrderedMap()创建空 Map。 -
OrderedMap
public OrderedMap(int initialCapacity) 创建带初始容量的 Map。- Parameters:
initialCapacity- 初始容量
-
OrderedMap
-
-
Method Details
-
firstKey
-
lastKey
-
removeFirst
-
removeLast
-
get
-