Top Constructors Methods
org.eclipse.collections.impl.map.sorted.immutable

public abstract Class AbstractImmutableSortedMap<K, V>

extends AbstractMapIterable<K, V>
implements ImmutableSortedMap<K, V>, SortedMap<K, V>
Class Inheritance
All Implemented Interfaces
java.util.SortedMap, java.util.SequencedMap, java.util.Map, org.eclipse.collections.api.map.sorted.ImmutableSortedMap, org.eclipse.collections.api.map.ImmutableMapIterable, org.eclipse.collections.api.map.MapIterable, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, org.eclipse.collections.api.map.sorted.SortedMapIterable, org.eclipse.collections.api.ordered.ReversibleIterable, org.eclipse.collections.api.ordered.OrderedIterable
Known Direct Subclasses
org.eclipse.collections.impl.map.sorted.immutable.ImmutableEmptySortedMap, org.eclipse.collections.impl.map.sorted.immutable.ImmutableTreeMap
Imports
java.util.Iterator, .LinkedHashMap, .Map, .Optional, .SortedMap, java.util.function.BiConsumer, org.eclipse.collections.api.bag.ImmutableBag, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Bags, .Lists, .Maps, .SortedMaps, org.eclipse.collections.api.factory.primitive.BooleanLists, .ByteLists, .CharLists, .DoubleLists, .FloatLists, .IntLists, .LongLists, .ObjectDoubleMaps, .ObjectLongMaps, .ShortLists, org.eclipse.collections.api.list.ImmutableList, .MutableList, org.eclipse.collections.api.list.primitive.ImmutableBooleanList, .ImmutableByteList, .ImmutableCharList, .ImmutableDoubleList, .ImmutableFloatList, .ImmutableIntList, .ImmutableLongList, .ImmutableShortList, .MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.map.ImmutableMap, .ImmutableOrderedMap, .MapIterable, .MutableMap, .MutableOrderedMap, org.eclipse.collections.api.map.primitive.ImmutableObjectDoubleMap, .ImmutableObjectLongMap, .MutableObjectDoubleMap, .MutableObjectLongMap, org.eclipse.collections.api.map.sorted.ImmutableSortedMap, .MutableSortedMap, org.eclipse.collections.api.multimap.list.ImmutableListMultimap, org.eclipse.collections.api.multimap.sortedset.ImmutableSortedSetMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.list.PartitionImmutableList, .PartitionMutableList, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.factory.Functions, .Predicates, .PrimitiveFunctions, org.eclipse.collections.impl.block.procedure.PartitionPredicate2Procedure, .PartitionProcedure, .SelectInstancesOfProcedure, org.eclipse.collections.impl.list.mutable.FastList, org.eclipse.collections.impl.map.AbstractMapIterable, org.eclipse.collections.impl.map.mutable.UnifiedMap, org.eclipse.collections.impl.map.ordered.mutable.OrderedMapAdapter, org.eclipse.collections.impl.map.sorted.mutable.TreeSortedMap, org.eclipse.collections.impl.multimap.list.FastListMultimap, org.eclipse.collections.impl.partition.list.PartitionFastList, org.eclipse.collections.impl.utility.MapIterate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <K1, V1, V2> ImmutableMap<K1, V2>
aggregateBy(Function<? super K, ? extends K1> keyFunction, Function<? super V, ? extends V1> valueFunction, Function0<? extends V2> zeroValueFactory, Function2<? super V2, ? super V1, ? extends V2> nonMutatingAggregator)

Overrides default org.eclipse.collections.api.map.sorted.ImmutableSortedMap.aggregateBy, org.eclipse.collections.api.map.MapIterable.aggregateBy.

Applies an aggregate function over the map grouping results into a map based on the specific key and value groupBy functions.

public SortedMap<K, V>
public SortedMap<K, V>
public void
clear()

Implements java.util.Map.clear.

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

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

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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> ImmutableMap<K2, V2>
collect(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.collect, org.eclipse.collections.api.map.MapIterable.collect.

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

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

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableByteList
collectByte(ByteFunction<? super V> byteFunction)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableCharList
collectChar(CharFunction<? super V> charFunction)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableDoubleList
collectDouble(DoubleFunction<? super V> doubleFunction)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableFloatList
collectFloat(FloatFunction<? super V> floatFunction)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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> ImmutableList<R>
collectIf(Predicate<? super V> predicate, Function<? super V, ? extends R> function)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableIntList
collectInt(IntFunction<? super V> intFunction)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 <R> ImmutableOrderedMap<R, V>
collectKeysUnique(Function2<? super K, ? super V, ? extends R> function)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.collectKeysUnique, org.eclipse.collections.api.map.MapIterable.collectKeysUnique.

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

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

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableShortList
collectShort(ShortFunction<? super V> shortFunction)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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> ImmutableSortedMap<K, R>
collectValues(Function2<? super K, ? super V, ? extends R> function)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.collectValues, org.eclipse.collections.api.map.MapIterable.collectValues.

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

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

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

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

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 <V1> ImmutableBag<V1>
countBy(Function<? super V, ? extends V1> function)

Overrides default org.eclipse.collections.api.RichIterable.countBy, org.eclipse.collections.api.map.ImmutableMapIterable.countBy.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V1> ImmutableBag<V1>
countByEach(Function<? super V, ? extends Iterable<V1>> function)

Overrides org.eclipse.collections.impl.AbstractRichIterable.countByEach.

Overrides default org.eclipse.collections.api.RichIterable.countByEach, org.eclipse.collections.api.map.ImmutableMapIterable.countByEach.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.

public <V1, P> ImmutableBag<V1>
countByWith(Function2<? super V, ? super P, ? extends V1> function, P parameter)

Overrides default org.eclipse.collections.api.RichIterable.countByWith, org.eclipse.collections.api.map.ImmutableMapIterable.countByWith.

This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.

public Pair<K, V>
detect(Predicate2<? super K, ? super V> predicate)

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

Return the first key and value of the map for which the predicate evaluates to true when they are given as arguments.

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 Optional<Pair<K, V>>
detectOptional(Predicate2<? super K, ? super V> predicate)

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

Return the first key and value of the map as an Optional for which the predicate evaluates to true when they are given as arguments.

public ImmutableList<V>
distinct()

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

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

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

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

Returns the final elements that do not satisfy the Predicate.

public <R> ImmutableList<R>
public ImmutableSortedSetMultimap<V, K>
flip()

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.flip, org.eclipse.collections.api.map.MapIterable.flip.

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

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
forEach(BiConsumer<? super K, ? super V> action)

Overrides default org.eclipse.collections.api.map.MapIterable.forEach, java.util.Map.forEach.

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.

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.

public <R> ImmutableListMultimap<R, V>
groupBy(Function<? super V, ? extends R> function)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 <R> ImmutableListMultimap<R, V>
groupByEach(Function<? super V, ? extends Iterable<R>> function)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.groupByEach, org.eclipse.collections.api.RichIterable.groupByEach.

Similar to groupBy(Function), except the result of evaluating function will return a collection of keys for each value.

public <V1> ImmutableMap<V1, V>
groupByUniqueKey(Function<? super V, ? extends V1> function)

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

Implements 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 SortedMap<K, V>
headMap(K toKey)

Implements java.util.SortedMap.headMap.

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

public Iterator<V>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
public PartitionImmutableList<V>
partition(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.partition, org.eclipse.collections.api.RichIterable.partition.

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

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

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

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

public <P> PartitionImmutableList<V>
partitionWith(Predicate2<? super V, ? super P> predicate, P parameter)

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

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

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 ImmutableList<V>
reject(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.reject, org.eclipse.collections.api.RichIterable.reject.

Returns all elements of the source collection that return false when evaluating of the predicate.

public ImmutableSortedMap<K, V>
reject(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.reject, org.eclipse.collections.api.map.MapIterable.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> ImmutableList<V>
rejectWith(Predicate2<? super V, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.rejectWith, org.eclipse.collections.api.RichIterable.rejectWith.

Similar to reject(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

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 ImmutableList<V>
select(Predicate<? super V> predicate)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.select, org.eclipse.collections.api.RichIterable.select.

Returns all elements of the source collection that return true when evaluating the predicate.

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

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.select, org.eclipse.collections.api.map.MapIterable.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> ImmutableList<S>
selectInstancesOf(Class<S> clazz)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.selectInstancesOf, org.eclipse.collections.api.RichIterable.selectInstancesOf.

Returns all elements of the source collection that are instances of the Class clazz.

public <P> ImmutableList<V>
selectWith(Predicate2<? super V, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.selectWith, org.eclipse.collections.api.RichIterable.selectWith.

Similar to select(Predicate), except with an evaluation parameter for the second generic argument in Predicate2.

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

Implements java.util.SortedMap.subMap.

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

public <V1> ImmutableObjectDoubleMap<V1>
sumByDouble(Function<? super V, ? extends V1> groupBy, DoubleFunction<? super V> function)

Implements org.eclipse.collections.api.RichIterable.sumByDouble.

Groups and sums the values using the two specified functions.

public <V1> ImmutableObjectDoubleMap<V1>
sumByFloat(Function<? super V, ? extends V1> groupBy, FloatFunction<? super V> function)

Implements org.eclipse.collections.api.RichIterable.sumByFloat.

Groups and sums the values using the two specified functions.

public <V1> ImmutableObjectLongMap<V1>
sumByInt(Function<? super V, ? extends V1> groupBy, IntFunction<? super V> function)

Implements org.eclipse.collections.api.RichIterable.sumByInt.

Groups and sums the values using the two specified functions.

public <V1> ImmutableObjectLongMap<V1>
sumByLong(Function<? super V, ? extends V1> groupBy, LongFunction<? super V> function)

Implements org.eclipse.collections.api.RichIterable.sumByLong.

Groups and sums the values using the two specified functions.

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

Implements java.util.SortedMap.tailMap.

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

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

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

Returns the initial elements that satisfy the Predicate.

public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
public ImmutableSortedMap<K, V>
toReversed()

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

Returns a new ReversibleIterable in reverse order.

public MutableSortedMap<K, V>
public MutableStack<V>
toStack()

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

Converts the OrderedIterable to a mutable MutableStack implementation.

public <S> ImmutableList<Pair<V, S>>
zip(Iterable<S> that)

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.zip, org.eclipse.collections.api.RichIterable.zip.

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

public ImmutableList<Pair<V, Integer>>
Inherited from org.eclipse.collections.impl.map.AbstractMapIterable:
allSatisfyallSatisfyWithanySatisfyanySatisfyWithasLazychunkcontainsdetectdetectIfNonedetectOptionaldetectWithdetectWithIfNonedetectWithOptionaleachforEachKeyforEachValueforEachWithforEachWithIndexgetFirstgetIfAbsentgetIfAbsentValuegetIfAbsentWithgetLastgetOnlygetOrDefaultifPresentApplyisAbsentkeyAndValueEqualskeyAndValueHashCodenoneSatisfynoneSatisfyWithtoArraytoArray