Java java.util TreeMap fields, constructors, methods, implement or subclass

Example usage for Java java.util TreeMap fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util TreeMap.

The text is from its open source code.

Subclass

java.util.TreeMap has subclasses.
Click this link to see all its subclasses.

Field

Comparatorcomparator
The comparator used to maintain order in this tree map, or null if it uses the natural ordering of its keys.
intsize
The number of entries in the tree
EntrySetentrySet
Fields initialized to contain an instance of the entry set view the first time this view is requested.
KeySetnavigableKeySet
NavigableMapdescendingMap

Constructor

TreeMap()
Constructs a new, empty tree map, using the natural ordering of its keys.
TreeMap(Comparator comparator)
Constructs a new, empty tree map, ordered according to the given comparator.
TreeMap(Map m)
Constructs a new tree map containing the same mappings as the given map, ordered according to the natural ordering of its keys.
TreeMap(SortedMap m)
Constructs a new tree map containing the same mappings and using the same ordering as the specified sorted map.

Method

Map.EntryceilingEntry(K key)
KceilingKey(K key)
voidclear()
Removes all of the mappings from this map.
Objectclone()
Returns a shallow copy of this TreeMap instance.
Vcompute(K key, BiFunction remappingFunction)
Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping).
booleancontainsKey(Object key)
Returns true if this map contains a mapping for the specified key.
booleancontainsValue(Object value)
Returns true if this map maps one or more keys to the specified value.
NavigableSetdescendingKeySet()
Map.EntryfirstEntry()
KfirstKey()
Map.EntryfloorEntry(K key)
KfloorKey(K key)
voidforEach(BiConsumer action)
Vget(Object key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
SortedMapheadMap(K toKey)
NavigableMapheadMap(K toKey, boolean inclusive)
Map.EntryhigherEntry(K key)
KhigherKey(K key)
booleanisEmpty()
Returns true if this map contains no key-value mappings.
SetkeySet()
Returns a Set view of the keys contained in this map.
Map.EntrylastEntry()
KlastKey()
Map.EntrylowerEntry(K key)
KlowerKey(K key)
voidnotifyAll()
Wakes up all threads that are waiting on this object's monitor.
Map.EntrypollFirstEntry()
Map.EntrypollLastEntry()
Vput(K key, V value)
Associates the specified value with the specified key in this map.
voidputAll(Map map)
Copies all of the mappings from the specified map to this map.
VputIfAbsent(K key, V value)
If the specified key is not already associated with a value (or is mapped to null ) associates it with the given value and returns null , else returns the current value.
Vremove(Object key)
Removes the mapping for this key from this TreeMap if present.
SortedMapsubMap(K fromKey, K toKey)
NavigableMapsubMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
SortedMaptailMap(K fromKey)
NavigableMaptailMap(K fromKey, boolean inclusive)
StringtoString()
Returns a string representation of the object.
Collectionvalues()
Returns a Collection view of the values contained in this map.
voidwait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.