A MutableMap
implemented using a red/black tree.
Entries in the map are maintained in a sorted order, from
smallest to largest key, as determined by the given
comparator function.
naturalOrderTreeMap()
no subtypes hierarchy
Initializer |
TreeMap(Comparison compare(Key x, Key y), {<Key->Item>*} entries = ...) |
Attributes | |
first | Source Codeshared actual <Key->Item>? first The first element returned by the iterator, if any, or
Refines Iterable.first |
hash | Source Codeshared actual Integer hash The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that:
Therefore, a class which refines |
last | Source Codeshared actual <Key->Item>? last The last element returned by the iterator, if any, or
Refines Iterable.last |
size | Source Codeshared actual Integer size The number of elements returned by the Refines Iterable.size |
string | Source Codeshared actual String string A developer-friendly string representing the instance.
Concatenates the name of the concrete class of the
instance with the |
Inherited Attributes |
Attributes inherited from: Collection<Element> |
Attributes inherited from: Correspondence<Key,Item> |
Attributes inherited from: Iterable<Element,Absent> |
Attributes inherited from: Map<Key,Item> |
Methods | |
assertInvariants | Source Codeshared void assertInvariants() |
clear | Source Codeshared actual void clear() Remove every entry from this map, leaving an empty map with no entries. Refines MapMutator.clear |
clone | Source Codeshared actual TreeMap<Key,Item> clone() A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned. |
contains | Source Codeshared actual Boolean contains(Object entry) Returns For most
However, it is possible to form a useful |
defines | Source Codeshared actual Boolean defines(Object key) Determines if there is a value defined for the given key. |
equals | Source Codeshared actual Boolean equals(Object that) Determine if two values are equal. Implementations should respect the constraints that:
Furthermore it is recommended that implementations
ensure that if A class which explicitly refines |
get | Source Codeshared actual Item? get(Object key) Returns the value defined for the given key, or |
higherEntries | Source Codeshared actual {<Key->Item>*} higherEntries(Key key) The entries with keys larger than the given Refines SortedMap.higherEntries |
iterator | Source Codeshared actual Iterator<Key->Item> iterator() An iterator for the elements belonging to this stream. Refines Iterable.iterator |
lowerEntries | Source Codeshared actual {<Key->Item>*} lowerEntries(Key key) The entries with keys smaller than the given Refines SortedMap.lowerEntries |
measure | Source Codeshared actual TreeMap<Key,Item> measure(Key from, Integer length) Obtain a measure containing the mapped values starting
from the given starting index ( The measure should contain the given number ( When the given index does not belong to this ranged object, the behavior is implementation dependent. Refines Ranged.measure |
put | Source Codeshared actual Item? put(Key key, Item item) Add an entry to this map, overwriting any existing
entry for the given |
remove | Source Codeshared actual Item? remove(Key key) Remove the entry associated with the given |
removeEntry | Source Codeshared actual Boolean removeEntry(Key key, Item&Object item) Remove the entry associated with the given Refines MapMutator.removeEntry |
replaceEntry | Source Codeshared actual Boolean replaceEntry(Key key, Item&Object item, Item newItem) |
span | Source Codeshared actual TreeMap<Key,Item> span(Key from, Key to) Obtain a span containing the elements between the two given indices. The span should contain elements of this stream,
starting from the element at the given starting
index ( When one or both of the given indices does not belong to this ranged stream, the behavior is implementation dependent. Refines Ranged.span |
spanFrom | Source Codeshared actual TreeMap<Key,Item> spanFrom(Key from) Obtain a span containing the elements between the given
starting index ( The span should contain elements of this stream,
starting from the element at the given starting
index ( When the given index does not belong to this ranged stream, the behavior is implementation dependent. Refines Ranged.spanFrom |
spanTo | Source Codeshared actual TreeMap<Key,Item> spanTo(Key to) Obtain a span containing the elements between the first
index of this ranged stream and given end index ( The span should contain elements of this stream, up to
the element at the given ending index ( When the given index does not belong to this ranged stream, the behavior is implementation dependent. Refines Ranged.spanTo |