K
- key typeV
- value typepublic class TreeMap<K,V> extends AbstractMap<K,V> implements SortedMap<K,V>, Serializable
Constructor and Description |
---|
TreeMap() |
TreeMap(Comparator<? super K> c) |
TreeMap(Map<? extends K,? extends V> map) |
TreeMap(SortedMap<K,? extends V> map) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Comparator<? super K> |
comparator() |
boolean |
containsKey(Object key) |
Set<Map.Entry<K,V>> |
entrySet() |
K |
firstKey() |
V |
get(Object k) |
protected java.util.TreeMap.Node<K,V> |
getNodeAtOrAfter(K key)
Returns the first node which compares equal to or greater than the given
key.
|
protected java.util.TreeMap.Node<K,V> |
getNodeBefore(K key)
Returns the last node which is strictly less than the given key.
|
SortedMap<K,V> |
headMap(K toKey) |
K |
lastKey() |
V |
put(K key,
V value) |
V |
remove(Object keyObj) |
int |
size() |
SortedMap<K,V> |
subMap(K fromKey,
K toKey) |
SortedMap<K,V> |
tailMap(K fromKey) |
containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
public TreeMap()
public TreeMap(Comparator<? super K> c)
public void clear()
public Comparator<? super K> comparator()
comparator
in interface SortedMap<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class AbstractMap<K,V>
public int size()
protected java.util.TreeMap.Node<K,V> getNodeAtOrAfter(K key)
key
- the key to search forprotected java.util.TreeMap.Node<K,V> getNodeBefore(K key)
key
- the key to search forCopyright © 2018. All rights reserved.