public final class LinkedTreeMap<K,V> extends AbstractMap<K,V> implements Serializable
TreeMap
, this class uses
insertion order for iteration order. Comparison order is only used as an
optimization for efficient insertion and removal.
This implementation was derived from Android 4.1's TreeMap class.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
构造器和说明 |
---|
LinkedTreeMap()
Create a natural order, empty tree map whose keys must be mutually
comparable and non-null.
|
LinkedTreeMap(Comparator<? super K> comparator)
Create a tree map ordered by
comparator . |
限定符和类型 | 方法和说明 |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
Set<K> |
keySet() |
V |
put(K key,
V value) |
V |
remove(Object key) |
int |
size() |
clone, containsValue, equals, hashCode, isEmpty, putAll, toString, values
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public LinkedTreeMap()
public LinkedTreeMap(Comparator<? super K> comparator)
comparator
. This map's keys may only
be null if comparator
permits.comparator
- the comparator to order elements with, or null
to
use the natural ordering.public boolean containsKey(Object key)
containsKey
在接口中 Map<K,V>
containsKey
在类中 AbstractMap<K,V>