public final class LinkedTreeMap<K,V>
extends java.util.AbstractMap<K,V>
implements java.io.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.
Constructor and Description |
---|
LinkedTreeMap()
Create a natural order, empty tree map whose keys must be mutually
comparable and non-null.
|
LinkedTreeMap(java.util.Comparator<? super K> comparator)
Create a tree map ordered by
comparator . |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
V |
remove(java.lang.Object key) |
int |
size() |
clone, containsValue, equals, hashCode, isEmpty, putAll, toString, values
public LinkedTreeMap()
public LinkedTreeMap(java.util.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 int size()
public V get(java.lang.Object key)
public boolean containsKey(java.lang.Object key)
public void clear()
public V remove(java.lang.Object key)