Example usage for Java java.util TreeMap fields, constructors, methods, implement or subclass
The text is from its open source code.
Comparator | comparator The comparator used to maintain order in this tree map, or null if it uses the natural ordering of its keys. |
int | size The number of entries in the tree |
EntrySet | entrySet Fields initialized to contain an instance of the entry set view the first time this view is requested. |
KeySet | navigableKeySet |
NavigableMap | descendingMap |
TreeMap() Constructs a new, empty tree map, using the natural ordering of its keys. | |
TreeMap(Comparator super K> comparator) Constructs a new, empty tree map, ordered according to the given comparator. | |
TreeMap(Map extends K, ? extends V> 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 Constructs a new tree map containing the same mappings and using the same ordering as the specified sorted map. |
Map.Entry | ceilingEntry(K key) |
K | ceilingKey(K key) |
void | clear() Removes all of the mappings from this map. |
Object | clone() Returns a shallow copy of this TreeMap instance. |
V | compute(K key, BiFunction super K, ? super V, ? extends V> remappingFunction) Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping). |
boolean | containsKey(Object key) Returns true if this map contains a mapping for the specified key. |
boolean | containsValue(Object value) Returns true if this map maps one or more keys to the specified value. |
NavigableSet | descendingKeySet() |
Map.Entry | firstEntry() |
K | firstKey() |
Map.Entry | floorEntry(K key) |
K | floorKey(K key) |
void | forEach(BiConsumer super K, ? super V> action) |
V | get(Object key) Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. |
SortedMap | headMap(K toKey) |
NavigableMap | headMap(K toKey, boolean inclusive) |
Map.Entry | higherEntry(K key) |
K | higherKey(K key) |
boolean | isEmpty() Returns true if this map contains no key-value mappings. |
Set | keySet() Returns a Set view of the keys contained in this map. |
Map.Entry | lastEntry() |
K | lastKey() |
Map.Entry | lowerEntry(K key) |
K | lowerKey(K key) |
void | notifyAll() Wakes up all threads that are waiting on this object's monitor. |
Map.Entry | pollFirstEntry() |
Map.Entry | pollLastEntry() |
V | put(K key, V value) Associates the specified value with the specified key in this map. |
void | putAll(Map extends K, ? extends V> map) Copies all of the mappings from the specified map to this map. |
V | putIfAbsent(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. |
V | remove(Object key) Removes the mapping for this key from this TreeMap if present. |
SortedMap | subMap(K fromKey, K toKey) |
NavigableMap | subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) |
SortedMap | tailMap(K fromKey) |
NavigableMap | tailMap(K fromKey, boolean inclusive) |
String | toString() Returns a string representation of the object. |
Collection | values() Returns a Collection view of the values contained in this map. |
void | wait(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. |