Top Methods
org.eclipse.collections.api.map.primitive

public Interface MutablePrimitiveObjectMap<V>

extends PrimitiveObjectMap<V>
Known Direct Subinterfaces
org.eclipse.collections.api.map.primitive.MutableIntObjectMap, org.eclipse.collections.api.map.primitive.MutableLongObjectMap, org.eclipse.collections.api.map.primitive.MutableShortObjectMap, org.eclipse.collections.api.map.primitive.MutableDoubleObjectMap, org.eclipse.collections.api.map.primitive.MutableByteObjectMap, org.eclipse.collections.api.map.primitive.MutableCharObjectMap, org.eclipse.collections.api.map.primitive.MutableFloatObjectMap
Imports
org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.bag.primitive.MutableBooleanBag, .MutableByteBag, .MutableCharBag, .MutableDoubleBag, .MutableFloatBag, .MutableIntBag, .MutableLongBag, .MutableShortBag, 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.Procedure2, org.eclipse.collections.api.factory.Maps, org.eclipse.collections.api.map.MutableMap, org.eclipse.collections.api.multimap.bag.MutableBagMultimap, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.partition.bag.PartitionMutableBag, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.tuple.Pair

Method Summary

Modifier and TypeMethod and Description
public default <K, VV> MutableMap<K, VV>
aggregateBy(Function<? super V, ? extends K> groupBy, Function0<? extends VV> zeroValueFactory, Function2<? super VV, ? super V, ? extends VV> nonMutatingAggregator)

Overrides default org.eclipse.collections.api.RichIterable.aggregateBy.

Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function.

public <K, VV> MutableMap<K, VV>
aggregateInPlaceBy(Function<? super V, ? extends K> groupBy, Function0<? extends VV> zeroValueFactory, Procedure2<? super VV, ? super V> mutatingAggregator)

Redeclares as abstract: org.eclipse.collections.api.RichIterable.aggregateInPlaceBy.

Applies an aggregate procedure over the iterable grouping results into a Map based on the specific groupBy function.

public void
public <VV> MutableBag<VV>
collect(Function<? super V, ? extends VV> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collect.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectBoolean.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectByte.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectChar.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectDouble.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectFloat.

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

public <VV> MutableBag<VV>
collectIf(Predicate<? super V> predicate, Function<? super V, ? extends VV> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.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 MutableIntBag
collectInt(IntFunction<? super V> intFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectInt.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectLong.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectShort.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectWith.

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

public <VV> MutableBag<VV>
flatCollect(Function<? super V, ? extends Iterable<VV>> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.flatCollect.

flatCollect is a special case of collect(Function).

public default <P, VV> MutableBag<VV>
flatCollectWith(Function2<? super V, ? super P, ? extends Iterable<VV>> function, P parameter)

Overrides default org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.flatCollectWith.

Same as flatCollect, only with a Function2 that is passed an extra parameter.

public <VV> MutableBagMultimap<VV, V>
groupBy(Function<? super V, ? extends VV> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.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 <VV> MutableBagMultimap<VV, V>
groupByEach(Function<? super V, ? extends Iterable<VV>> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.groupByEach.

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

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

Implements org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.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 PartitionMutableBag<V>
partition(Predicate<? super V> predicate)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.partition.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.partitionWith.

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

public default <K> MutableMap<K, V>
reduceBy(Function<? super V, ? extends K> groupBy, Function2<? super V, ? super V, ? extends V> reduceFunction)

Overrides default org.eclipse.collections.api.RichIterable.reduceBy.

Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function.

public MutableBag<V>
reject(Predicate<? super V> predicate)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.reject.

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

public <P> MutableBag<V>
rejectWith(Predicate2<? super V, ? super P> predicate, P parameter)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.rejectWith.

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

public MutableBag<V>
select(Predicate<? super V> predicate)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.select.

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

public <S> MutableBag<S>
selectInstancesOf(Class<S> clazz)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.selectInstancesOf.

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

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.selectWith.

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

public <VV> MutableObjectDoubleMap<VV>
sumByDouble(Function<? super V, ? extends VV> groupBy, DoubleFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByDouble.

Groups and sums the values using the two specified functions.

public <VV> MutableObjectDoubleMap<VV>
sumByFloat(Function<? super V, ? extends VV> groupBy, FloatFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByFloat.

Groups and sums the values using the two specified functions.

public <VV> MutableObjectLongMap<VV>
sumByInt(Function<? super V, ? extends VV> groupBy, IntFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByInt.

Groups and sums the values using the two specified functions.

public <VV> MutableObjectLongMap<VV>
sumByLong(Function<? super V, ? extends VV> groupBy, LongFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByLong.

Groups and sums the values using the two specified functions.

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

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.zip.

Deprecated in 7.0. Use OrderedIterable#zip(Iterable) instead.

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

public MutableSet<Pair<V, Integer>>
zipWithIndex()

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.zipWithIndex.

Deprecated in 7.0. Use OrderedIterable#zipWithIndex() instead.

Zips this RichIterable with its indices.

Inherited from org.eclipse.collections.api.map.primitive.PrimitiveObjectMap:
containsValueequalsforEachValuehashCodeparallelStreamspliteratorstreamtoStringvalues

Method Detail

aggregateByback to summary
public default <K, VV> MutableMap<K, VV> aggregateBy(Function<? super V, ? extends K> groupBy, Function0<? extends VV> zeroValueFactory, Function2<? super VV, ? super V, ? extends VV> nonMutatingAggregator)

Overrides default org.eclipse.collections.api.RichIterable.aggregateBy.

Doc from org.eclipse.collections.api.RichIterable.aggregateBy.

Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function. Aggregate results are allowed to be immutable as they will be replaced in place in the map. A second function specifies the initial "zero" aggregate value to work with (i.e. Integer.valueOf(0)).

Annotations
@Override
aggregateInPlaceByback to summary
public <K, VV> MutableMap<K, VV> aggregateInPlaceBy(Function<? super V, ? extends K> groupBy, Function0<? extends VV> zeroValueFactory, Procedure2<? super VV, ? super V> mutatingAggregator)

Redeclares as abstract: org.eclipse.collections.api.RichIterable.aggregateInPlaceBy.

Doc from org.eclipse.collections.api.RichIterable.aggregateInPlaceBy.

Applies an aggregate procedure over the iterable grouping results into a Map based on the specific groupBy function. Aggregate results are required to be mutable as they will be changed in place by the procedure. A second function specifies the initial "zero" aggregate value to work with (i.e. new AtomicInteger(0)).

Annotations
@Override
clearback to summary
public void clear()
collectback to summary
public <VV> MutableBag<VV> collect(Function<? super V, ? extends VV> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collect.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

RichIterable<String> names =
    people.collect(person -> person.getFirstName() + " " + person.getLastName());
Annotations
@Override
collectBooleanback to summary
public MutableBooleanBag collectBoolean(BooleanFunction<? super V> booleanFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectBoolean.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

BooleanIterable licenses =
    people.collectBoolean(person -> person.hasDrivingLicense());
Annotations
@Override
collectByteback to summary
public MutableByteBag collectByte(ByteFunction<? super V> byteFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectByte.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

ByteIterable bytes =
    people.collectByte(person -> person.getCode());
Annotations
@Override
collectCharback to summary
public MutableCharBag collectChar(CharFunction<? super V> charFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectChar.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

CharIterable chars =
    people.collectChar(person -> person.getMiddleInitial());
Annotations
@Override
collectDoubleback to summary
public MutableDoubleBag collectDouble(DoubleFunction<? super V> doubleFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectDouble.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

DoubleIterable doubles =
    people.collectDouble(person -> person.getMilesFromNorthPole());
Annotations
@Override
collectFloatback to summary
public MutableFloatBag collectFloat(FloatFunction<? super V> floatFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectFloat.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

FloatIterable floats =
    people.collectFloat(person -> person.getHeightInInches());
Annotations
@Override
collectIfback to summary
public <VV> MutableBag<VV> collectIf(Predicate<? super V> predicate, Function<? super V, ? extends VV> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectIf.

Doc from 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. This is the optimized equivalent of calling iterable.select(predicate).collect(function).

Example using a Java 8 lambda and method reference:

RichIterable<String> strings = Lists.mutable.with(1, 2, 3).collectIf(e -> e != null, Object::toString);

Example using Predicates factory:

RichIterable<String> strings = Lists.mutable.with(1, 2, 3).collectIf(Predicates.notNull(), Functions.getToString());
Annotations
@Override
collectIntback to summary
public MutableIntBag collectInt(IntFunction<? super V> intFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectInt.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

IntIterable ints =
    people.collectInt(person -> person.getAge());
Annotations
@Override
collectLongback to summary
public MutableLongBag collectLong(LongFunction<? super V> longFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectLong.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

LongIterable longs =
    people.collectLong(person -> person.getGuid());
Annotations
@Override
collectShortback to summary
public MutableShortBag collectShort(ShortFunction<? super V> shortFunction)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectShort.

Doc from 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. This method is also commonly called transform or map.

Example using a Java 8 lambda expression:

ShortIterable shorts =
    people.collectShort(person -> person.getNumberOfJunkMailItemsReceivedPerMonth());
Annotations
@Override
collectWithback to summary
public <P, VV> MutableBag<VV> collectWith(Function2<? super V, ? super P, ? extends VV> function, P parameter)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.collectWith.

Doc from org.eclipse.collections.api.RichIterable.collectWith.

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

Example using a Java 8 lambda expression:

RichIterable<Integer> integers =
    Lists.mutable.with(1, 2, 3).collectWith((each, parameter) -> each + parameter, Integer.valueOf(1));
Annotations
@Override
flatCollectback to summary
public <VV> MutableBag<VV> flatCollect(Function<? super V, ? extends Iterable<VV>> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.flatCollect.

Doc from org.eclipse.collections.api.RichIterable.flatCollect.

flatCollect is a special case of collect(Function). With collect, when the Function returns a collection, the result is a collection of collections. flatCollect outputs a single "flattened" collection instead. This method is commonly called flatMap.

Consider the following example where we have a Person class, and each Person has a list of Address objects. Take the following Function:

Function<Person, List<Address>> addressFunction = Person::getAddresses;
RichIterable<Person> people = ...;
Using collect returns a collection of collections of addresses.
RichIterable<List<Address>> addresses = people.collect(addressFunction);
Using flatCollect returns a single flattened list of addresses.
RichIterable<Address> addresses = people.flatCollect(addressFunction);
Annotations
@Override
flatCollectWithback to summary
public default <P, VV> MutableBag<VV> flatCollectWith(Function2<? super V, ? super P, ? extends Iterable<VV>> function, P parameter)

Overrides default org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.flatCollectWith.

Doc from org.eclipse.collections.api.RichIterable.flatCollectWith.

Same as flatCollect, only with a Function2 that is passed an extra parameter.

Annotations
@Override
Since
9.2
groupByback to summary
public <VV> MutableBagMultimap<VV, V> groupBy(Function<? super V, ? extends VV> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.groupBy.

Doc from 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.

Example using a Java 8 method reference:

Multimap<String, Person> peopleByLastName =
    people.groupBy(Person::getLastName);
Annotations
@Override
groupByEachback to summary
public <VV> MutableBagMultimap<VV, V> groupByEach(Function<? super V, ? extends Iterable<VV>> function)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.groupByEach.

Doc from 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.

Annotations
@Override
groupByUniqueKeyback to summary
public default <VV> MutableMap<VV, V> groupByUniqueKey(Function<? super V, ? extends VV> function)

Implements org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.groupByUniqueKey.

Doc from 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. The generated keys must each be unique, or else an exception is thrown.

Annotations
@Override
partitionback to summary
public PartitionMutableBag<V> partition(Predicate<? super V> predicate)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.partition.

Doc from org.eclipse.collections.api.RichIterable.partition.

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

Example using a Java 8 lambda expression:

PartitionIterable<Person> newYorkersAndNonNewYorkers =
    people.partition(person -> person.getAddress().getState().getName().equals("New York"));
Annotations
@Override
partitionWithback to summary
public <P> PartitionMutableBag<V> partitionWith(Predicate2<? super V, ? super P> predicate, P parameter)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.partitionWith.

Doc from org.eclipse.collections.api.RichIterable.partitionWith.

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

Example using a Java 8 lambda expression:

PartitionIterable<Person> newYorkersAndNonNewYorkers =
    people.partitionWith((Person person, String state) -> person.getAddress().getState().getName().equals(state), "New York");
Annotations
@Override
reduceByback to summary
public default <K> MutableMap<K, V> reduceBy(Function<? super V, ? extends K> groupBy, Function2<? super V, ? super V, ? extends V> reduceFunction)

Overrides default org.eclipse.collections.api.RichIterable.reduceBy.

Doc from org.eclipse.collections.api.RichIterable.reduceBy.

Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function. Aggregate results are allowed to be immutable as they will be replaced in place in the map.

Annotations
@Override
rejectback to summary
public MutableBag<V> reject(Predicate<? super V> predicate)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.reject.

Doc from org.eclipse.collections.api.RichIterable.reject.

Returns all elements of the source collection that return false when evaluating of the predicate. This method is also sometimes called filterNot and is the equivalent of calling iterable.select(Predicates.not(predicate)).

Example using a Java 8 lambda expression:

RichIterable<Person> rejected =
    people.reject(person -> person.person.getLastName().equals("Smith"));
Annotations
@Override
rejectWithback to summary
public <P> MutableBag<V> rejectWith(Predicate2<? super V, ? super P> predicate, P parameter)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.rejectWith.

Doc from org.eclipse.collections.api.RichIterable.rejectWith.

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

E.g. return a Collection of Person elements where the person has an age greater than or equal to 18 years

Example using a Java 8 lambda expression:

RichIterable<Person> rejected =
    people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18));
Annotations
@Override
selectback to summary
public MutableBag<V> select(Predicate<? super V> predicate)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.select.

Doc from org.eclipse.collections.api.RichIterable.select.

Returns all elements of the source collection that return true when evaluating the predicate. This method is also commonly called filter.

Example using a Java 8 lambda expression:

RichIterable<Person> selected =
    people.select(person -> person.getAddress().getCity().equals("London"));
Annotations
@Override
selectInstancesOfback to summary
public <S> MutableBag<S> selectInstancesOf(Class<S> clazz)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.selectInstancesOf.

Doc from org.eclipse.collections.api.RichIterable.selectInstancesOf.

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

RichIterable<Integer> integers =
    List.mutable.with(new Integer(0), new Long(0L), new Double(0.0)).selectInstancesOf(Integer.class);
Annotations
@Override
selectWithback to summary
public <P> MutableBag<V> selectWith(Predicate2<? super V, ? super P> predicate, P parameter)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.selectWith.

Doc from org.eclipse.collections.api.RichIterable.selectWith.

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

E.g. return a Collection of Person elements where the person has an age greater than or equal to 18 years

Example using a Java 8 lambda expression:

RichIterable<Person> selected =
    people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18));
Annotations
@Override
sumByDoubleback to summary
public <VV> MutableObjectDoubleMap<VV> sumByDouble(Function<? super V, ? extends VV> groupBy, DoubleFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByDouble.

Doc from org.eclipse.collections.api.RichIterable.sumByDouble.

Groups and sums the values using the two specified functions.

Annotations
@Override
sumByFloatback to summary
public <VV> MutableObjectDoubleMap<VV> sumByFloat(Function<? super V, ? extends VV> groupBy, FloatFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByFloat.

Doc from org.eclipse.collections.api.RichIterable.sumByFloat.

Groups and sums the values using the two specified functions.

Annotations
@Override
sumByIntback to summary
public <VV> MutableObjectLongMap<VV> sumByInt(Function<? super V, ? extends VV> groupBy, IntFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByInt.

Doc from org.eclipse.collections.api.RichIterable.sumByInt.

Groups and sums the values using the two specified functions.

Annotations
@Override
sumByLongback to summary
public <VV> MutableObjectLongMap<VV> sumByLong(Function<? super V, ? extends VV> groupBy, LongFunction<? super V> function)

Redeclares org.eclipse.collections.api.RichIterable.sumByLong.

Doc from org.eclipse.collections.api.RichIterable.sumByLong.

Groups and sums the values using the two specified functions.

Annotations
@Override
zipback to summary
public <S> MutableBag<Pair<V, S>> zip(Iterable<S> that)

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.zip.

Doc from org.eclipse.collections.api.RichIterable.zip.

Deprecated

in 7.0. Use OrderedIterable#zip(Iterable) instead.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs. If one of the two RichIterables is longer than the other, its remaining elements are ignored.

Annotations
@Override
@Deprecated
zipWithIndexback to summary
public MutableSet<Pair<V, Integer>> zipWithIndex()

Redeclares org.eclipse.collections.api.map.primitive.PrimitiveObjectMap.zipWithIndex.

Doc from org.eclipse.collections.api.RichIterable.zipWithIndex.

Deprecated

in 7.0. Use OrderedIterable#zipWithIndex() instead.

Zips this RichIterable with its indices.

Annotations
@Override
@Deprecated