Top Fields Constructors Methods
org.eclipse.collections.impl.map.sorted.mutable

public Class TreeSortedMap<K, V>

extends AbstractMutableSortedMap<K, V>
implements Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.util.Comparator, .Iterator, .Map, .SortedMap, .TreeMap, org.eclipse.collections.api.block.predicate.Predicate, org.eclipse.collections.api.block.procedure.Procedure2, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.factory.SortedMaps, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.map.sorted.MutableSortedMap, org.eclipse.collections.api.partition.list.PartitionMutableList, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.factory.Functions, org.eclipse.collections.impl.block.procedure.MapCollectProcedure, org.eclipse.collections.impl.collection.mutable.CollectionAdapter, org.eclipse.collections.impl.set.mutable.SetAdapter, org.eclipse.collections.impl.utility.ArrayIterate, .MapIterate

Field Summary

Modifier and TypeField and Description
private static final long
private TreeMap<K, V>

Constructor Summary

AccessConstructor and Description
public
public
TreeSortedMap(Comparator<? super K> comparator)

public
TreeSortedMap(Map<? extends K, ? extends V> map)

public
TreeSortedMap(Comparator<? super K> comparator, Map<? extends K, ? extends V> map)

public
TreeSortedMap(SortedMap<K, ? extends V> map)

public
TreeSortedMap(Pair<K, V>... pairs)

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).

public TreeSortedMap<K, V>
public Comparator<? super K>
comparator()

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.comparator, java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

public boolean
containsKey(Object key)

Implements org.eclipse.collections.api.map.MapIterable.containsKey, java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public boolean
containsValue(Object value)

Implements org.eclipse.collections.api.map.MapIterable.containsValue, java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.

public MutableList<V>
distinct()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.distinct.

Returns a new OrderedIterable containing the distinct elements in this iterable.

public MutableSortedMap<K, V>
drop(int count)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public MutableSortedMap<K, V>
dropWhile(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.dropWhile.

Returns the final elements that do not satisfy the Predicate.

public MutableSet<Map.Entry<K, V>>
entrySet()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.entrySet, java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.

public boolean
public K
firstKey()

Implements java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

public void
forEachKeyValue(Procedure2<? super K, ? super V> procedure2)

Implements org.eclipse.collections.api.map.MapIterable.forEachKeyValue.

Calls the procedure with each key-value pair of the map.

public V
get(Object key)

Implements org.eclipse.collections.api.map.MapIterable.get, java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

public int
public MutableSortedMap<K, V>
headMap(K toKey)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey.

public MutableSet<K>
keySet()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.keySet, java.util.Map.keySet.

The underlying set for the keys is sorted in ascending order according to their natural ordering or a custom comparator.

public K
lastKey()

Implements java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

public MutableSortedMap<K, V>
newEmpty()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.newEmpty, org.eclipse.collections.api.map.MutableMapIterable.newEmpty.

Creates a new instance of the same type with the same internal Comparator.

public static <K, V> TreeSortedMap<K, V>
public static <K, V> TreeSortedMap<K, V>
newMap(Comparator<? super K> comparator)

public static <K, V> TreeSortedMap<K, V>
newMap(Map<? extends K, ? extends V> map)

public static <K, V> TreeSortedMap<K, V>
newMap(Comparator<? super K> comparator, Map<? extends K, ? extends V> map)

public static <K, V> TreeSortedMap<K, V>
newMapWith(Pair<K, V>... pairs)

public static <K, V> TreeSortedMap<K, V>
newMapWith(Comparator<? super K> comparator, Pair<K, V>... pairs)

public static <K, V> TreeSortedMap<K, V>
newMapWith(K key, V value)

public static <K, V> TreeSortedMap<K, V>
newMapWith(K key1, V value1, K key2, V value2)

public static <K, V> TreeSortedMap<K, V>
newMapWith(K key1, V value1, K key2, V value2, K key3, V value3)

public static <K, V> TreeSortedMap<K, V>
newMapWith(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)

public static <K, V> TreeSortedMap<K, V>
newMapWith(Comparator<? super K> comparator, K key, V value)

public static <K, V> TreeSortedMap<K, V>
newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2)

public static <K, V> TreeSortedMap<K, V>
newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3)

public static <K, V> TreeSortedMap<K, V>
newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)

public PartitionMutableList<V>
partitionWhile(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.partitionWhile.

Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements.

public V
put(K key, V value)

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).

public void
putAll(Map<? extends K, ? extends V> map)

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).

public void
readExternal(ObjectInput in)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public V
remove(Object key)

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).

public V
removeKey(K key)

Implements org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Remove an entry from the map at the specified key.

public int
size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Map.size.

Returns the number of key-value mappings in this map.

public MutableSortedMap<K, V>
subMap(K fromKey, K toKey)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.

public MutableSortedMap<K, V>
tailMap(K fromKey)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.

public MutableSortedMap<K, V>
take(int count)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public MutableSortedMap<K, V>
takeWhile(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.takeWhile.

Returns the initial elements that satisfy the Predicate.

public MutableSortedMap<K, V>
toReversed()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.toReversed.

Returns a new ReversibleIterable in reverse order.

public String
toString()

Overrides org.eclipse.collections.impl.AbstractRichIterable.toString.

Implements org.eclipse.collections.api.map.MapIterable.toString, org.eclipse.collections.api.RichIterable.toString.

Returns a string with the keys and values of this map separated by commas with spaces and enclosed in curly braces.

public MutableCollection<V>
values()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.values, java.util.Map.values.

Returns a Collection view of the values contained in this map.

public TreeSortedMap<K, V>
with(K key, V value)

public TreeSortedMap<K, V>
with(K key1, V value1, K key2, V value2)

public TreeSortedMap<K, V>
with(K key1, V value1, K key2, V value2, K key3, V value3)

public TreeSortedMap<K, V>
with(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)

public TreeSortedMap<K, V>
public void
writeExternal(ObjectOutput out)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.map.sorted.mutable.AbstractMutableSortedMap:
asSynchronizedasUnmodifiablecollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectKeysAndValuescollectKeysUniquecollectLongcollectShortcollectValuescollectWithcorrespondsdetectIndexdetectLastIndexflatCollectflipforEachforEachWithIndexgroupBygroupByEachgroupByUniqueKeypartitionpartitionWithrejectrejectrejectWithselectselectselectInstancesOfselectWithtaptoImmutabletoStackwithAllKeyValueArgumentswithAllKeyValueswithKeyValuewithoutAllKeyswithoutKeyzipzipWithIndex

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID
treeMapback to summary
private TreeMap<K, V> treeMap

Constructor Detail

TreeSortedMapback to summary
public TreeSortedMap()
TreeSortedMapback to summary
public TreeSortedMap(Comparator<? super K> comparator)
TreeSortedMapback to summary
public TreeSortedMap(Map<? extends K, ? extends V> map)
TreeSortedMapback to summary
public TreeSortedMap(Comparator<? super K> comparator, Map<? extends K, ? extends V> map)
TreeSortedMapback to summary
public TreeSortedMap(SortedMap<K, ? extends V> map)
TreeSortedMapback to summary
public TreeSortedMap(Pair<K, V>... pairs)

Method Detail

clearback to summary
public void clear()

Implements java.util.Map.clear.

Doc from java.util.Map.clear.

Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.

Annotations
@Override
cloneback to summary
public TreeSortedMap<K, V> clone()

Implements abstract org.eclipse.collections.impl.map.sorted.mutable.AbstractMutableSortedMap.clone.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Annotations
@Override
comparatorback to summary
public Comparator<? super K> comparator()

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.comparator, java.util.SortedMap.comparator.

Doc from java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

Annotations
@Override
containsKeyback to summary
public boolean containsKey(Object key)

Implements org.eclipse.collections.api.map.MapIterable.containsKey, java.util.Map.containsKey.

Doc from java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that Objects.equals(key, k). (There can be at most one such mapping.)

Annotations
@Override
containsValueback to summary
public boolean containsValue(Object value)

Implements org.eclipse.collections.api.map.MapIterable.containsValue, java.util.Map.containsValue.

Doc from java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value. More formally, returns true if and only if this map contains at least one mapping to a value v such that Objects.equals(value, v). This operation will probably require time linear in the map size for most implementations of the Map interface.

Annotations
@Override
distinctback to summary
public MutableList<V> distinct()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.distinct.

Doc from org.eclipse.collections.api.ordered.OrderedIterable.distinct.

Returns a new OrderedIterable containing the distinct elements in this iterable.

Conceptually similar to toSet().toList() but retains the original order. If an element appears multiple times in this iterable, the first one will be copied into the result.

Annotations
@Override
dropback to summary
public MutableSortedMap<K, V> drop(int count)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.drop.

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

Annotations
@Override
dropWhileback to summary
public MutableSortedMap<K, V> dropWhile(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.dropWhile.

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.dropWhile.

Returns the final elements that do not satisfy the Predicate. Short circuits at the first element which does satisfy the Predicate.

Annotations
@Override
entrySetback to summary
public MutableSet<Map.Entry<K, V>> entrySet()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.entrySet, java.util.Map.entrySet.

Doc from java.util.SortedMap.entrySet.

Returns a Set view of the mappings contained in this map. The set's iterator returns the entries in ascending key order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation, or through the setValue operation on a map entry returned by the iterator) the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.map.MapIterable.equals, java.util.Map.equals.

Doc from org.eclipse.collections.api.map.MapIterable.equals.

Follows the same general contract as Map#equals(Object).

Annotations
@Override
firstKeyback to summary
public K firstKey()

Implements java.util.SortedMap.firstKey.

Doc from java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

Annotations
@Override
forEachKeyValueback to summary
public void forEachKeyValue(Procedure2<? super K, ? super V> procedure2)

Implements org.eclipse.collections.api.map.MapIterable.forEachKeyValue.

Doc from org.eclipse.collections.api.map.MapIterable.forEachKeyValue.

Calls the procedure with each key-value pair of the map.

    final Collection<String> collection = new ArrayList<String>();
    MutableMap<Integer, String> map = this.newMapWithKeysValues(1, "One", 2, "Two", 3, "Three");
    map.forEachKeyValue((Integer key, String value) -> collection.add(String.valueOf(key) + value));
    Verify.assertContainsAll(collection, "1One", "2Two", "3Three");
Annotations
@Override
getback to summary
public V get(Object key)

Implements org.eclipse.collections.api.map.MapIterable.get, java.util.Map.get.

Doc from java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.eclipse.collections.api.map.MapIterable.hashCode, java.util.Map.hashCode.

Doc from org.eclipse.collections.api.map.MapIterable.hashCode.

Follows the same general contract as Map#hashCode().

Annotations
@Override
headMapback to summary
public MutableSortedMap<K, V> headMap(K toKey)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.headMap.

Doc from java.util.SortedMap.headMap.

Returns a view of the portion of this map whose keys are strictly less than toKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Annotations
@Override
keySetback to summary
public MutableSet<K> keySet()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.keySet, java.util.Map.keySet.

Doc from org.eclipse.collections.api.map.sorted.MutableSortedMap.keySet.

The underlying set for the keys is sorted in ascending order according to their natural ordering or a custom comparator. However, Java 5 TreeMap returns a keySet that does not inherit from SortedSet therefore we have decided to return the keySet simply as a MutableSet to maintain Java 5 compatibility.

Annotations
@Override
lastKeyback to summary
public K lastKey()

Implements java.util.SortedMap.lastKey.

Doc from java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

Annotations
@Override
newEmptyback to summary
public MutableSortedMap<K, V> newEmpty()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.newEmpty, org.eclipse.collections.api.map.MutableMapIterable.newEmpty.

Doc from org.eclipse.collections.api.map.sorted.MutableSortedMap.newEmpty.

Creates a new instance of the same type with the same internal Comparator.

Annotations
@Override
newMapback to summary
public static <K, V> TreeSortedMap<K, V> newMap()
newMapback to summary
public static <K, V> TreeSortedMap<K, V> newMap(Comparator<? super K> comparator)
newMapback to summary
public static <K, V> TreeSortedMap<K, V> newMap(Map<? extends K, ? extends V> map)
newMapback to summary
public static <K, V> TreeSortedMap<K, V> newMap(Comparator<? super K> comparator, Map<? extends K, ? extends V> map)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(Pair<K, V>... pairs)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(Comparator<? super K> comparator, Pair<K, V>... pairs)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(K key, V value)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(K key1, V value1, K key2, V value2)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(K key1, V value1, K key2, V value2, K key3, V value3)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(Comparator<? super K> comparator, K key, V value)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3)
newMapWithback to summary
public static <K, V> TreeSortedMap<K, V> newMapWith(Comparator<? super K> comparator, K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
partitionWhileback to summary
public PartitionMutableList<V> partitionWhile(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.partitionWhile.

Doc from org.eclipse.collections.api.ordered.OrderedIterable.partitionWhile.

Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements. Short circuits at the first element which does satisfy the Predicate.

Annotations
@Override
putback to summary
public V put(K key, V value)

Implements java.util.Map.put.

Doc from java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Annotations
@Override
putAllback to summary
public void putAll(Map<? extends K, ? extends V> map)

Implements java.util.Map.putAll.

Doc from java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation). The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress. If the specified map has a defined encounter order, processing of its mappings generally occurs in that order.

Annotations
@Override
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Annotations
@Override
Exceptions
IOException:
if I/O errors occur
ClassNotFoundException:
If the class for an object being restored cannot be found.
removeback to summary
public V remove(Object key)

Implements java.util.Map.remove.

Doc from java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

Annotations
@Override
removeKeyback to summary
public V removeKey(K key)

Implements org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Doc from org.eclipse.collections.api.map.MutableMapIterable.removeKey.

Remove an entry from the map at the specified key.

Annotations
@Override
sizeback to summary
public int size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Map.size.

Doc from java.util.Map.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Annotations
@Override
subMapback to summary
public MutableSortedMap<K, V> subMap(K fromKey, K toKey)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.subMap.

Doc from java.util.SortedMap.subMap.

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive. (If fromKey and toKey are equal, the returned map is empty.) The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Annotations
@Override
tailMapback to summary
public MutableSortedMap<K, V> tailMap(K fromKey)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.tailMap.

Doc from java.util.SortedMap.tailMap.

Returns a view of the portion of this map whose keys are greater than or equal to fromKey. The returned map is backed by this map, so changes in the returned map are reflected in this map, and vice-versa. The returned map supports all optional map operations that this map supports.

The returned map will throw an IllegalArgumentException on an attempt to insert a key outside its range.

Annotations
@Override
takeback to summary
public MutableSortedMap<K, V> take(int count)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.take.

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

Annotations
@Override
takeWhileback to summary
public MutableSortedMap<K, V> takeWhile(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.takeWhile.

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.takeWhile.

Returns the initial elements that satisfy the Predicate. Short circuits at the first element which does not satisfy the Predicate.

Annotations
@Override
toReversedback to summary
public MutableSortedMap<K, V> toReversed()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.toReversed.

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.toReversed.

Returns a new ReversibleIterable in reverse order.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.collections.impl.AbstractRichIterable.toString.

Implements org.eclipse.collections.api.map.MapIterable.toString, org.eclipse.collections.api.RichIterable.toString.

Doc from org.eclipse.collections.api.map.MapIterable.toString.

Returns a string with the keys and values of this map separated by commas with spaces and enclosed in curly braces. Each key and value is separated by an equals sign.

Assert.assertEquals("{1=1, 2=2, 3=3}", Maps.mutable.with(1, 1, 2, 2, 3, 3).toString());
Annotations
@Override
valuesback to summary
public MutableCollection<V> values()

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.values, java.util.Map.values.

Doc from java.util.SortedMap.values.

Returns a Collection view of the values contained in this map. The collection's iterator returns the values in ascending order of the corresponding keys. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Annotations
@Override
withback to summary
public TreeSortedMap<K, V> with(K key, V value)
withback to summary
public TreeSortedMap<K, V> with(K key1, V value1, K key2, V value2)
withback to summary
public TreeSortedMap<K, V> with(K key1, V value1, K key2, V value2, K key3, V value3)
withback to summary
public TreeSortedMap<K, V> with(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4)
withback to summary
public TreeSortedMap<K, V> with(Pair<K, V>... pairs)

Overrides default org.eclipse.collections.api.map.sorted.MutableSortedMap.with.

Annotations
@Override
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Annotations
@Override
Exceptions
IOException:
Includes any I/O exceptions that may occur