public class TreeMap<K,V> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
TreeMap.TreeEntry<K,V> |
Constructor and Description |
---|
TreeMap() |
TreeMap(Comparator<? super K> comparator) |
Modifier and Type | Method and Description |
---|---|
TreeMap.TreeEntry<K,V> |
ceilingEntry(K key)
Returns a key-value mapping associated with the least key greater than or
equal to the given key, or null if there is no such key.
|
void |
clear()
Clears all elements in this map.
|
Comparator<? super K> |
comparator() |
boolean |
containsKey(K key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
TreeMap.TreeEntry<K,V> |
firstEntry()
Returns a key-value mapping associated with the least key in this map, or
null if the map is empty.
|
K |
firstKey() |
TreeMap.TreeEntry<K,V> |
floorEntry(K key)
Returns a key-value mapping associated with the greatest key less than or
equal to the given key, or null if there is no such key.
|
V |
get(K key) |
TreeMap.TreeEntry<K,V> |
getEntry(K key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
TreeMap.TreeEntry<K,V> |
lastEntry()
Returns a key-value mapping associated with the greatest key in this map,
or null if the map is empty.
|
K |
lastKey() |
TreeMap.TreeEntry<K,V> |
lowerEntry(K key)
Returns a key-value mapping associated with the greatest key strictly
less than the given key, or null if there is no such key
|
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(K key) |
V |
removeEntry(TreeMap.TreeEntry<K,V> n)
complicated red-black delete stuff.
|
int |
size() |
TreeMap.TreeEntry<K,V> |
upperEntry(K key)
Returns a key-value mapping associated with the lowest key strictly
greater than the given key, or null if there is no such key
|
Collection<V> |
values() |
public TreeMap()
public TreeMap(Comparator<? super K> comparator)
public Comparator<? super K> comparator()
public K firstKey()
public K lastKey()
public void clear()
public boolean containsKey(K key)
public boolean containsValue(Object value)
public final TreeMap.TreeEntry<K,V> getEntry(K key)
public TreeMap.TreeEntry<K,V> firstEntry()
public TreeMap.TreeEntry<K,V> lastEntry()
public TreeMap.TreeEntry<K,V> lowerEntry(K key)
key
- the key.public TreeMap.TreeEntry<K,V> floorEntry(K key)
key
- The key for which to search.public TreeMap.TreeEntry<K,V> upperEntry(K key)
key
- The keypublic TreeMap.TreeEntry<K,V> ceilingEntry(K key)
key
- public boolean isEmpty()
public final V removeEntry(TreeMap.TreeEntry<K,V> n)
n
- the node to be deletedpublic int size()
public Collection<V> values()
Copyright © 2009–2016 FuseSource, Corp.. All rights reserved.