edu.emory.mathcs.backport.java.util

Class TreeMap

public class TreeMap extends AbstractMap implements NavigableMap, Serializable

Sorted map implementation based on a red-black tree and implementing all the methods from the NavigableMap interface.

Author: Dawid Kurzyniec

Nested Class Summary
static classTreeMap.Entry
Constructor Summary
TreeMap()
TreeMap(Comparator comparator)
TreeMap(SortedMap map)
TreeMap(Map map)
Method Summary
EntryceilingEntry(Object key)
ObjectceilingKey(Object key)
voidclear()
Objectclone()
Comparatorcomparator()
booleancontainsKey(Object key)
booleancontainsValue(Object value)
NavigableSetdescendingKeySet()
NavigableMapdescendingMap()
SetentrySet()
EntryfirstEntry()
ObjectfirstKey()
EntryfloorEntry(Object key)
ObjectfloorKey(Object key)
Objectget(Object key)
SortedMapheadMap(Object toKey)
NavigableMapheadMap(Object toKey, boolean toInclusive)
EntryhigherEntry(Object key)
ObjecthigherKey(Object key)
booleanisEmpty()
SetkeySet()
EntrylastEntry()
ObjectlastKey()
EntrylowerEntry(Object key)
ObjectlowerKey(Object key)
NavigableSetnavigableKeySet()
EntrypollFirstEntry()
EntrypollLastEntry()
Objectput(Object key, Object value)
voidputAll(Map map)
Objectremove(Object key)
intsize()
SortedMapsubMap(Object fromKey, Object toKey)
NavigableMapsubMap(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive)
SortedMaptailMap(Object fromKey)
NavigableMaptailMap(Object fromKey, boolean fromInclusive)

Constructor Detail

TreeMap

public TreeMap()

TreeMap

public TreeMap(Comparator comparator)

TreeMap

public TreeMap(SortedMap map)

TreeMap

public TreeMap(Map map)

Method Detail

ceilingEntry

public Entry ceilingEntry(Object key)

Since: 1.6

ceilingKey

public Object ceilingKey(Object key)

Since: 1.6

clear

public void clear()

clone

public Object clone()

comparator

public Comparator comparator()

containsKey

public boolean containsKey(Object key)

containsValue

public boolean containsValue(Object value)

descendingKeySet

public NavigableSet descendingKeySet()

descendingMap

public NavigableMap descendingMap()

Since: 1.6

entrySet

public Set entrySet()

firstEntry

public Entry firstEntry()

Since: 1.6

firstKey

public Object firstKey()

floorEntry

public Entry floorEntry(Object key)

Since: 1.6

floorKey

public Object floorKey(Object key)

Since: 1.6

get

public Object get(Object key)
{@inheritDoc }

headMap

public SortedMap headMap(Object toKey)

headMap

public NavigableMap headMap(Object toKey, boolean toInclusive)

higherEntry

public Entry higherEntry(Object key)

Since: 1.6

higherKey

public Object higherKey(Object key)

Since: 1.6

isEmpty

public boolean isEmpty()

keySet

public Set keySet()

lastEntry

public Entry lastEntry()

Since: 1.6

lastKey

public Object lastKey()

lowerEntry

public Entry lowerEntry(Object key)

Since: 1.6

lowerKey

public Object lowerKey(Object key)

Since: 1.6

navigableKeySet

public NavigableSet navigableKeySet()

pollFirstEntry

public Entry pollFirstEntry()

Since: 1.6

pollLastEntry

public Entry pollLastEntry()

Since: 1.6

put

public Object put(Object key, Object value)

putAll

public void putAll(Map map)

remove

public Object remove(Object key)

size

public int size()

subMap

public SortedMap subMap(Object fromKey, Object toKey)

subMap

public NavigableMap subMap(Object fromKey, boolean fromInclusive, Object toKey, boolean toInclusive)

tailMap

public SortedMap tailMap(Object fromKey)

tailMap

public NavigableMap tailMap(Object fromKey, boolean fromInclusive)