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

public Class SynchronizedSortedMap<K, V>

extends AbstractSynchronizedMapIterable<K, V>
implements MutableSortedMap<K, V>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.eclipse.collections.api.map.sorted.MutableSortedMap, java.lang.Cloneable, java.util.SortedMap, java.util.SequencedMap, java.util.Map, org.eclipse.collections.api.map.sorted.SortedMapIterable, org.eclipse.collections.api.ordered.ReversibleIterable, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, org.eclipse.collections.api.map.MapIterable, org.eclipse.collections.api.map.MutableMapIterable
Imports
java.io.Serializable, java.util.Collection, .Comparator, .Map, .Optional, .SortedMap, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ObjectIntToObjectFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.predicate.primitive.ObjectIntPredicate, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.factory.SortedMaps, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.list.primitive.MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.map.MapIterable, .MutableMap, .MutableMapIterable, .MutableOrderedMap, org.eclipse.collections.api.map.sorted.ImmutableSortedMap, .MutableSortedMap, org.eclipse.collections.api.multimap.list.MutableListMultimap, org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.list.PartitionMutableList, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.collection.mutable.SynchronizedMutableCollection, org.eclipse.collections.impl.list.fixed.ArrayAdapter, org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable, org.eclipse.collections.impl.map.mutable.SynchronizedMapSerializationProxy, org.eclipse.collections.impl.set.mutable.SynchronizedMutableSet

A synchronized view of a SortedMap.
See Also
SynchronizedSortedMap(MutableSortedMap)

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public MutableSortedMap<K, V>
public MutableSortedMap<K, V>
public MutableSortedMap<K, V>
clone()

Overrides java.lang.Object.clone.

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

Creates and returns a copy of this object.

public <R> MutableList<R>
collect(Function<? super V, ? extends R> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collect.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collect, org.eclipse.collections.api.RichIterable.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public <K2, V2> MutableMap<K2, V2>
collect(Function2<? super K, ? super V, Pair<K2, V2>> function)

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

For each key and value of the map the function is evaluated.

public MutableBooleanList
collectBoolean(BooleanFunction<? super V> booleanFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectBoolean.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectBoolean, org.eclipse.collections.api.RichIterable.collectBoolean.

Returns a new primitive boolean iterable with the results of applying the specified function on each element of the source collection.

public MutableByteList
collectByte(ByteFunction<? super V> byteFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectByte.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectByte, org.eclipse.collections.api.RichIterable.collectByte.

Returns a new primitive byte iterable with the results of applying the specified function on each element of the source collection.

public MutableCharList
collectChar(CharFunction<? super V> charFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectChar.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectChar, org.eclipse.collections.api.RichIterable.collectChar.

Returns a new primitive char iterable with the results of applying the specified function on each element of the source collection.

public MutableDoubleList
collectDouble(DoubleFunction<? super V> doubleFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectDouble.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectDouble, org.eclipse.collections.api.RichIterable.collectDouble.

Returns a new primitive double iterable with the results of applying the specified function on each element of the source collection.

public MutableFloatList
collectFloat(FloatFunction<? super V> floatFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectFloat.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectFloat, org.eclipse.collections.api.RichIterable.collectFloat.

Returns a new primitive float iterable with the results of applying the specified function on each element of the source collection.

public <R> MutableList<R>
collectIf(Predicate<? super V> predicate, Function<? super V, ? extends R> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectIf.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectIf, org.eclipse.collections.api.RichIterable.collectIf.

Returns a new collection with the results of applying the specified function on each element of the source collection, but only for those elements which return true upon evaluation of the predicate.

public MutableIntList
collectInt(IntFunction<? super V> intFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectInt.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectInt, org.eclipse.collections.api.RichIterable.collectInt.

Returns a new primitive int iterable with the results of applying the specified function on each element of the source collection.

public <E> MutableSortedMap<K, V>
collectKeysAndValues(Iterable<E> iterable, Function<? super E, ? extends K> keyFunction, Function<? super E, ? extends V> function)

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

Adds all the entries derived from iterable to this.

public <R> MutableOrderedMap<R, V>
collectKeysUnique(Function2<? super K, ? super V, ? extends R> function)

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

For each key and value of the map the function is evaluated.

public MutableLongList
collectLong(LongFunction<? super V> longFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectLong.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectLong, org.eclipse.collections.api.RichIterable.collectLong.

Returns a new primitive long iterable with the results of applying the specified function on each element of the source collection.

public MutableShortList
collectShort(ShortFunction<? super V> shortFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectShort.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectShort, org.eclipse.collections.api.RichIterable.collectShort.

Returns a new primitive short iterable with the results of applying the specified function on each element of the source collection.

public <R> MutableSortedMap<K, R>
collectValues(Function2<? super K, ? super V, ? extends R> function)

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

For each key and value of the map the function is evaluated.

public <P, VV> MutableList<VV>
collectWith(Function2<? super V, ? super P, ? extends VV> function, P parameter)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectWith.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.collectWith, org.eclipse.collections.api.RichIterable.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

public <R> MutableList<R>
collectWithIndex(ObjectIntToObjectFunction<? super V, ? extends R> function)

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

Returns a new OrderedIterable using results obtained by applying the specified function to each element and its corresponding index.

public <V1, R extends Collection<V1>> R
collectWithIndex(ObjectIntToObjectFunction<? super V, ? extends V1> function, R target)

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.collectWithIndex.

Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.

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 <S> boolean
corresponds(OrderedIterable<S> other, Predicate2<? super V, ? super S> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.corresponds.

Returns true if both OrderedIterables have the same length and predicate returns true for all corresponding elements e1 of this OrderedIterable and e2 of other.

public int
detectIndex(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.ordered.OrderedIterable.detectIndex.

Returns the index of the first element of the OrderedIterable for which the predicate evaluates to true.

public int
detectLastIndex(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.ordered.ReversibleIterable.detectLastIndex.

Returns the index of the last element of the ReversibleIterable for which the predicate evaluates to true.

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 K
firstKey()

Implements java.util.SortedMap.firstKey.

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

public <R> MutableList<R>
public MutableSortedSetMultimap<V, K>
flip()

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

Given a map from Domain -> Range return a multimap from Range -> Domain.

public MutableMapIterable<V, K>
flipUniqueValues()

Implements org.eclipse.collections.api.map.MutableMapIterable.flipUniqueValues, org.eclipse.collections.api.map.MapIterable.flipUniqueValues.

Return the MapIterable that is obtained by flipping the direction of this map and making the associations from value to key.

public void
forEach(int startIndex, int endIndex, Procedure<? super V> procedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEach.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public void
forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super V> objectIntProcedure)

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the section of the iterable covered by the specified inclusive indexes.

protected MutableSortedMap<K, V>
public Optional<V>
getFirstOptional()

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.getFirstOptional.

Returns the first element of an iterable as an Optional.

public Optional<V>
getLastOptional()

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.getLastOptional.

Returns the last element of an iterable as an Optional.

public <KK> MutableListMultimap<KK, V>
groupBy(Function<? super V, ? extends KK> function)

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.groupBy.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.groupBy, org.eclipse.collections.api.map.MutableMapIterable.groupBy, org.eclipse.collections.api.RichIterable.groupBy.

For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable.

public <KK> MutableListMultimap<KK, V>
public <VV> MutableMap<VV, V>
groupByUniqueKey(Function<? super V, ? extends VV> function)

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.groupByUniqueKey.

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

Implements org.eclipse.collections.api.map.MutableMapIterable.groupByUniqueKey, org.eclipse.collections.api.RichIterable.groupByUniqueKey.

For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key.

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 int
indexOf(Object object)

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.indexOf.

Returns the index of the first occurrence of the specified item in this iterable, or -1 if this iterable does not contain the item.

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, M extends SortedMap<K, V>> SynchronizedSortedMap<K, V>
of(M map)

This method will take a MutableSortedMap and wrap it directly in a SynchronizedSortedMap.

public static <K, V, M extends SortedMap<K, V>> SynchronizedSortedMap<K, V>
of(M map, Object lock)

Hides java.util.Map.of.

Returns an unmodifiable map containing a single mapping.

public PartitionMutableList<V>
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 <P> PartitionMutableList<V>
partitionWith(Predicate2<? super V, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.partitionWith.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.partitionWith, org.eclipse.collections.api.RichIterable.partitionWith.

Filters a collection into a PartitionIterable based on the evaluation of the predicate.

public void
public MutableList<V>
public MutableSortedMap<K, V>
reject(Predicate2<? super K, ? super V> predicate)

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

For each key and value of the map the predicate is evaluated, if the result of the evaluation is false, that key and value are returned in a new map.

public <P> MutableList<V>
public <R extends Collection<V>> R
rejectWithIndex(ObjectIntPredicate<? super V> predicate, R target)

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.rejectWithIndex.

Adds all elements to the target Collection that return false when evaluating the specified predicate which is supplied each element and its relative index.

public void
reverseForEach(Procedure<? super V> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEach.

Evaluates the procedure for each element of the list iterating in reverse order.

public void
reverseForEachWithIndex(ObjectIntProcedure<? super V> procedure)

Overrides default org.eclipse.collections.api.ordered.ReversibleIterable.reverseForEachWithIndex.

Evaluates the procedure for each element and it's index in reverse order.

public MutableList<V>
public MutableSortedMap<K, V>
select(Predicate2<? super K, ? super V> predicate)

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

For each key and value of the map the predicate is evaluated, if the result of the evaluation is true, that key and value are returned in a new map.

public <S> MutableList<S>
public <P> MutableList<V>
public <R extends Collection<V>> R
selectWithIndex(ObjectIntPredicate<? super V> predicate, R target)

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.selectWithIndex.

Adds all elements to the target Collection that return true when evaluating the specified predicate which is supplied each element and its relative index.

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>
public ImmutableSortedMap<K, V>
public MutableSortedMap<K, V>
toReversed()

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

Returns a new ReversibleIterable in reverse order.

public MutableStack<V>
toStack()

Overrides default org.eclipse.collections.api.ordered.OrderedIterable.toStack.

Converts the OrderedIterable to a mutable MutableStack implementation.

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 MutableSortedMap<K, V>
with(Pair<K, V>... pairs)

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

Deprecated in 6.0 Use withAllKeyValueArguments(Pair[]) instead.

public MutableSortedMap<K, V>
public MutableSortedMap<K, V>
withAllKeyValues(Iterable<? extends Pair<? extends K, ? extends V>> keyValues)

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

This method allows mutable, fixed size, and immutable maps the ability to add elements to their existing elements.

public MutableSortedMap<K, V>
withKeyValue(K key, V value)

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

This method allows mutable, fixed size, and immutable maps the ability to add elements to their existing elements.

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

Overrides default org.eclipse.collections.api.map.sorted.MutableSortedMap.withMap, org.eclipse.collections.api.map.MutableMapIterable.withMap.

Similar to putAll(Map), but returns this instead of void

public MutableSortedMap<K, V>
public MutableSortedMap<K, V>
withoutAllKeys(Iterable<? extends K> keys)

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

This method allows mutable, fixed size, and immutable maps the ability to remove elements from their existing elements.

public MutableSortedMap<K, V>
withoutKey(K key)

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

This method allows mutable, fixed size, and immutable maps the ability to remove elements from their existing elements.

protected Object
public <S> MutableList<Pair<V, S>>
zip(Iterable<S> that)

Overrides org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable.zip.

Implements org.eclipse.collections.api.map.sorted.MutableSortedMap.zip, org.eclipse.collections.api.map.MutableMapIterable.zip, org.eclipse.collections.api.RichIterable.zip.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public MutableList<Pair<V, Integer>>
Inherited from org.eclipse.collections.impl.map.AbstractSynchronizedMapIterable:
addaggregateByaggregateByaggregateInPlaceByclearcontainsKeycontainsValuecountBycountByEachcountByWithdetectdetectOptionalforEachKeyforEachKeyValueforEachValuegetgetIfAbsentgetIfAbsentPutgetIfAbsentPutgetIfAbsentPutWithgetIfAbsentPutWithKeygetIfAbsentValuegetIfAbsentWithifPresentApplykeysViewkeyValuesViewmergeputputAllputPairreduceByremoveremoveAllKeysremoveIfremoveKeysumByDoublesumByFloatsumByIntsumByLongupdateValueupdateValueWithvaluesView