Top Constructors Methods
org.eclipse.collections.impl

public abstract Class AbstractRichIterable<T>

extends Object
implements RichIterable<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable
Known Direct Subclasses
org.eclipse.collections.impl.bag.AbstractBag, org.eclipse.collections.impl.collection.immutable.AbstractImmutableCollection, org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection, org.eclipse.collections.impl.lazy.AbstractLazyIterable, org.eclipse.collections.impl.map.AbstractMapIterable, org.eclipse.collections.impl.stack.immutable.ImmutableEmptyStack, org.eclipse.collections.impl.stack.immutable.ImmutableNotEmptyStack
Imports
java.io.IOException, java.util.Collection, .Comparator, .Optional, org.eclipse.collections.api.LazyIterable, .RichIterable, org.eclipse.collections.api.bag.Bag, .MutableBag, org.eclipse.collections.api.bag.sorted.MutableSortedBag, org.eclipse.collections.api.bimap.MutableBiMap, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.function.primitive.DoubleFunction, .DoubleObjectToDoubleFunction, .FloatFunction, .FloatObjectToFloatFunction, .IntFunction, .IntObjectToIntFunction, .LongFunction, .LongObjectToLongFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Bags, .BiMaps, .Lists, .Maps, .Sets, .SortedBags, .SortedMaps, .SortedSets, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.map.MutableMap, .MutableMapIterable, org.eclipse.collections.api.map.sorted.MutableSortedMap, org.eclipse.collections.api.multimap.MutableMultimap, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.set.sorted.MutableSortedSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.block.factory.Comparators, .Functions, .Predicates, .Predicates2, .Procedures, .Procedures2, org.eclipse.collections.impl.block.procedure.AppendStringProcedure, .BiMapCollectProcedure, .CollectIfProcedure, .CollectProcedure, .CountProcedure, .FlatCollectProcedure, .GroupByUniqueKeyProcedure, .InjectIntoProcedure, .MapCollectProcedure, .MaxByProcedure, .MaxComparatorProcedure, .MaxProcedure, .MinByProcedure, .MinComparatorProcedure, .MinProcedure, .MultimapEachPutProcedure, .MultimapPutProcedure, .RejectProcedure, .SelectProcedure, .SumOfDoubleProcedure, .SumOfFloatProcedure, .SumOfIntProcedure, .SumOfLongProcedure, .ZipWithIndexProcedure, org.eclipse.collections.impl.block.procedure.primitive.InjectIntoDoubleProcedure, .InjectIntoFloatProcedure, .InjectIntoIntProcedure, .InjectIntoLongProcedure, org.eclipse.collections.impl.utility.ArrayIterate, .Iterate, .LazyIterate, org.eclipse.collections.impl.utility.internal.IterableIterate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
allSatisfy(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.RichIterable.allSatisfy.

Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.

public <P> boolean
allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.RichIterable.allSatisfyWith.

Returns true if the predicate evaluates to true for every element of the collection, or returns false.

public boolean
anySatisfy(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.RichIterable.anySatisfy.

Returns true if the predicate evaluates to true for any element of the iterable.

public <P> boolean
anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.RichIterable.anySatisfyWith.

Returns true if the predicate evaluates to true for any element of the collection, or return false.

public void
appendString(Appendable appendable, String separator)

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

Prints a string representation of this collection onto the given Appendable.

public void
appendString(Appendable appendable, String start, String separator, String end)

Implements org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public LazyIterable<T>
asLazy()

Implements org.eclipse.collections.api.RichIterable.asLazy.

Returns a lazy (deferred) iterable, most likely implemented by calling LazyIterate.adapt(this).

public <V, R extends Collection<V>> R
collect(Function<? super T, ? extends V> function, R target)

Implements org.eclipse.collections.api.RichIterable.collect.

Same as collect(Function), except that the results are gathered into the specified target collection.

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

Implements org.eclipse.collections.api.RichIterable.collectIf.

Same as the collectIf method with two parameters but uses the specified target collection for the results.

public <P, V, R extends Collection<V>> R
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter, R target)

Implements org.eclipse.collections.api.RichIterable.collectWith.

Same as collectWith but with a targetCollection parameter to gather the results.

public boolean
contains(Object object)

Implements org.eclipse.collections.api.RichIterable.contains.

Returns true if the iterable has an element which responds true to element.equals(object).

public boolean
containsAll(Collection<?> collection)

Implements org.eclipse.collections.api.RichIterable.containsAll.

Returns true if all elements in source are contained in this collection.

public boolean
containsAllArguments(Object... elements)

Implements org.eclipse.collections.api.RichIterable.containsAllArguments.

Returns true if all elements in the specified var arg array are contained in this collection.

public boolean
containsAllIterable(Iterable<?> source)

Implements org.eclipse.collections.api.RichIterable.containsAllIterable.

Returns true if all elements in source are contained in this collection.

public int
count(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.RichIterable.count.

Return the total number of elements that answer true to the specified predicate.

public <V> Bag<V>
countByEach(Function<? super T, ? extends Iterable<V>> function)

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

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

public <P> int
countWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.RichIterable.countWith.

Returns the total number of elements that evaluate to true for the specified predicate.

public T
detect(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.RichIterable.detect.

Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true.

public Optional<T>
detectOptional(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.RichIterable.detectOptional.

Returns the first element of the iterable for which the predicate evaluates to true as an Optional.

public <P> T
detectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.RichIterable.detectWith.

Returns the first element that evaluates to true for the specified predicate2 and parameter, or null if none evaluate to true.

public <P> T
detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function)

Implements org.eclipse.collections.api.RichIterable.detectWithIfNone.

Returns the first element of the iterable that evaluates to true for the specified predicate2 and parameter, or returns the value of evaluating the specified function.

public <P> Optional<T>
detectWithOptional(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.RichIterable.detectWithOptional.

Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional.

public <V, R extends Collection<V>> R
flatCollect(Function<? super T, ? extends Iterable<V>> function, R target)

Implements org.eclipse.collections.api.RichIterable.flatCollect.

Same as flatCollect, only the results are collected into the target collection.

public final void
forEach(Procedure<? super T> procedure)

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

The procedure is executed for each element in the iterable.

public <P> void
forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public <V, R extends MutableMultimap<V, T>> R
groupBy(Function<? super T, ? extends V> function, R target)

Implements org.eclipse.collections.api.RichIterable.groupBy.

Same as groupBy(Function), except that the results are gathered into the specified target multimap.

public <V, R extends MutableMultimap<V, T>> R
groupByEach(Function<? super T, ? extends Iterable<V>> function, R target)

Implements org.eclipse.collections.api.RichIterable.groupByEach.

Same as groupByEach(Function), except that the results are gathered into the specified target multimap.

public <V, R extends MutableMapIterable<V, T>> R
groupByUniqueKey(Function<? super T, ? extends V> function, R target)

Implements org.eclipse.collections.api.RichIterable.groupByUniqueKey.

Same as groupByUniqueKey(Function), except that the results are gathered into the specified target map.

public <IV> IV
injectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function)

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public int
injectInto(int injectedValue, IntObjectToIntFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public long
injectInto(long injectedValue, LongObjectToLongFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public double
injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public float
injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final float result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public <R extends Collection<T>> R
into(R target)

Implements org.eclipse.collections.api.RichIterable.into.

Adds all the elements in this iterable to the specific target Collection.

public boolean
isEmpty()

Implements org.eclipse.collections.api.RichIterable.isEmpty.

Returns true if this iterable has zero items.

public T
max(Comparator<? super T> comparator)

Implements org.eclipse.collections.api.RichIterable.max.

Returns the maximum element out of this container based on the comparator.

public T
max()

Implements org.eclipse.collections.api.RichIterable.max.

Returns the maximum element out of this container based on the natural order.

public <V extends Comparable<? super V>> T
maxBy(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.RichIterable.maxBy.

Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.

public T
min(Comparator<? super T> comparator)

Implements org.eclipse.collections.api.RichIterable.min.

Returns the minimum element out of this container based on the comparator.

public T
min()

Implements org.eclipse.collections.api.RichIterable.min.

Returns the minimum element out of this container based on the natural order.

public <V extends Comparable<? super V>> T
minBy(Function<? super T, ? extends V> function)

Implements org.eclipse.collections.api.RichIterable.minBy.

Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.

public boolean
noneSatisfy(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.RichIterable.noneSatisfy.

Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.

public <P> boolean
noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.RichIterable.noneSatisfyWith.

Returns true if the predicate evaluates to false for every element of the collection, or return false.

public <R extends Collection<T>> R
reject(Predicate<? super T> predicate, R target)

Implements org.eclipse.collections.api.RichIterable.reject.

Same as the reject method with one parameter but uses the specified target collection for the results.

public <P, R extends Collection<T>> R
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Implements org.eclipse.collections.api.RichIterable.rejectWith.

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

public <R extends Collection<T>> R
select(Predicate<? super T> predicate, R target)

Implements org.eclipse.collections.api.RichIterable.select.

Same as the select method with one parameter but uses the specified target collection for the results.

public <P, R extends Collection<T>> R
selectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Implements org.eclipse.collections.api.RichIterable.selectWith.

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

public double
sumOfDouble(DoubleFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.sumOfDouble.

Returns the final double result of evaluating function for each element of the iterable and adding the results together.

public double
sumOfFloat(FloatFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.sumOfFloat.

Returns the final double result of evaluating function for each element of the iterable and adding the results together.

public long
sumOfInt(IntFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.sumOfInt.

Returns the final long result of evaluating function for each element of the iterable and adding the results together.

public long
sumOfLong(LongFunction<? super T> function)

Implements org.eclipse.collections.api.RichIterable.sumOfLong.

Returns the final long result of evaluating function for each element of the iterable and adding the results together.

public MutableBag<T>
toBag()

Implements org.eclipse.collections.api.RichIterable.toBag.

Converts the collection to the default MutableBag implementation.

public <K, V> MutableBiMap<K, V>
toBiMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)

Implements org.eclipse.collections.api.RichIterable.toBiMap.

Converts the collection to a BiMap implementation using the specified key and value functions.

public MutableList<T>
toList()

Implements org.eclipse.collections.api.RichIterable.toList.

Converts the collection to a MutableList implementation.

public <K, V> MutableMap<K, V>
toMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)

Implements org.eclipse.collections.api.RichIterable.toMap.

Converts the collection to a MutableMap implementation using the specified key and value functions.

public MutableSet<T>
toSet()

Implements org.eclipse.collections.api.RichIterable.toSet.

Converts the collection to a MutableSet implementation.

public MutableSortedBag<T>
toSortedBag()

Implements org.eclipse.collections.api.RichIterable.toSortedBag.

Converts the collection to a MutableSortedBag implementation and sorts it using the natural order of the elements.

public MutableSortedBag<T>
toSortedBag(Comparator<? super T> comparator)

Implements org.eclipse.collections.api.RichIterable.toSortedBag.

Converts the collection to the MutableSortedBag implementation and sorts it using the specified comparator.

public <V extends Comparable<? super V>> MutableSortedBag<T>
toSortedBagBy(Function<? super T, ? extends V> function)

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

Converts the collection to a MutableSortedBag implementation and sorts it based on the natural order of the attribute returned by function.

public <V extends Comparable<? super V>> MutableList<T>
toSortedListBy(Function<? super T, ? extends V> function)

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

Converts the collection to a MutableList implementation and sorts it based on the natural order of the attribute returned by function.

public <K, V> MutableSortedMap<K, V>
toSortedMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)

Implements org.eclipse.collections.api.RichIterable.toSortedMap.

Converts the collection to a MutableSortedMap implementation using the specified key and value functions sorted by the key elements' natural ordering.

public <K, V> MutableSortedMap<K, V>
toSortedMap(Comparator<? super K> comparator, Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)

Implements org.eclipse.collections.api.RichIterable.toSortedMap.

Converts the collection to a MutableSortedMap implementation using the specified key and value functions sorted by the given comparator.

public <KK extends Comparable<? super KK>, NK, NV> MutableSortedMap<NK, NV>
toSortedMapBy(Function<? super NK, KK> sortBy, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)

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

Converts the collection to a MutableSortedMap implementation using the specified key and value functions and sorts it based on the natural order of the attribute returned by sortBy function.

public MutableSortedSet<T>
toSortedSet()

Implements org.eclipse.collections.api.RichIterable.toSortedSet.

Converts the collection to a MutableSortedSet implementation and sorts it using the natural order of the elements.

public MutableSortedSet<T>
toSortedSet(Comparator<? super T> comparator)

Implements org.eclipse.collections.api.RichIterable.toSortedSet.

Converts the collection to a MutableSortedSet implementation and sorts it using the specified comparator.

public <V extends Comparable<? super V>> MutableSortedSet<T>
toSortedSetBy(Function<? super T, ? extends V> function)

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

Converts the collection to a MutableSortedSet implementation and sorts it based on the natural order of the attribute returned by function.

public String

Returns:

a string representation of this collection.
toString
()

Overrides java.lang.Object.toString.

Implements org.eclipse.collections.api.RichIterable.toString.

Returns a string with the elements of the iterable separated by commas with spaces and enclosed in square brackets.

public <S, R extends Collection<Pair<T, S>>> R
zip(Iterable<S> that, R target)

Implements org.eclipse.collections.api.RichIterable.zip.

Same as zip(Iterable) but uses target for output.

public <R extends Collection<Pair<T, Integer>>> R
zipWithIndex(R target)

Implements org.eclipse.collections.api.RichIterable.zipWithIndex.

Same as zipWithIndex() but uses target for output.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait