The methods in RichIterable are organized into the following method categories via region comments which are collapsible in various IDEs. Links are provided below as a convenience to help discover specific methods in Javadoc.
anySatisfy(Predicate), anySatisfyWith(Predicate2, Object), noneSatisfy(Predicate),
noneSatisfyWith(Predicate2, Object), allSatisfy(Predicate), allSatisfyWith(Predicate2, Object),
contains(Object) ,
containsAll(Collection), containsAllArguments(Object...) , containsAllIterable(Iterable),
containsAny(Collection) , containsAnyIterable(Iterable),
containsNone(Collection) , containsNoneIterable(Iterable) ,
containsBy(Function, Object),
isEmpty(), notEmpty()
detect(Predicate), detectIfNone(Predicate, Function0) ,
detectWith(Predicate2, Object), detectWithIfNone(Predicate2, Object, Function0),
detectOptional(Predicate), detectWithOptional(Predicate2, Object),
getAny(), getFirst(), getLast(), getOnly(),
min(), max(),
minBy(Function), minByOptional(Function), minOptional()
maxBy(Function), maxByOptional(Function), maxOptional()
collect(Function), collectIf(Predicate, Function), collectWith(Function2, Object),
collectBoolean(BooleanFunction), collectByte(ByteFunction), collectChar(CharFunction),
collectDouble(DoubleFunction), collectFloat(FloatFunction), collectInt(IntFunction),
collectLong(LongFunction), collectShort(ShortFunction),
flatCollect(Function), flatCollectWith(Function2, Object),
flatCollectBoolean(Function, MutableBooleanCollection), flatCollectByte(Function, MutableByteCollection) ,
flatCollectChar(Function, MutableCharCollection), flatCollectDouble(Function, MutableDoubleCollection) ,
flatCollectFloat(Function, MutableFloatCollection), flatCollectInt(Function, MutableIntCollection) ,
flatCollectLong(Function, MutableLongCollection), flatCollectShort(Function, MutableShortCollection) ,
zip(Iterable), zipWithIndex(Collection)
aggregateBy(Function, Function0, Function2) , aggregateInPlaceBy(Function, Function0, Procedure2) ,
injectInto(Object, Function2) ,
injectIntoDouble(double, DoubleObjectToDoubleFunction) ,
injectIntoFloat(float, FloatObjectToFloatFunction) , injectIntoInt(int, IntObjectToIntFunction) ,
injectIntoLong(long, LongObjectToLongFunction) ,
reduce(BinaryOperator), reduceBy(Function, Function2), reduceInPlace(Collector) ,
sumByDouble(Function, DoubleFunction) , sumByFloat(Function, FloatFunction) ,
sumByInt(Function, IntFunction) , sumByLong(Function, LongFunction) ,
sumOfDouble(DoubleFunction), sumOfFloat(FloatFunction), sumOfInt(IntFunction), sumOfLong(LongFunction) ,
summarizeDouble(DoubleFunction), summarizeFloat(FloatFunction),
summarizeInt(IntFunction), summarizeLong(LongFunction)
into(Collection), appendString(Appendable), makeString(), toString(),
toArray(), toBag(), toBiMap(Function, Function), toList() ,
toMap(Function, Function), toSet(), toSortedBag(), toSortedBagBy(Function),
toSortedList(), toSortedListBy(Function), toSortedMap(Function, Function),
toSortedMapBy(Function, Function, Function), toSortedSet(), toSortedSetBy(Function),
toImmutableBag(), toImmutableBiMap(Function, Function), toImmutableList(),
toImmutableMap(Function, Function), toImmutableSet(),
toImmutableSortedBag(), toImmutableSortedBagBy(Function), toImmutableSortedList(),
toImmutableSortedListBy(Function) , toImmutableSortedSet() , toImmutableSortedSetBy(Function)
| Modifier and Type | Method and Description |
|---|---|
| public default <K, V> MapIterable | aggregateBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator)
Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function. |
| public default <K, V, R extends MutableMapIterable | aggregateBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator, R target)
Applies an aggregate function over the iterable grouping results into the target map based on the specific groupBy function. |
| public default <K, V> MapIterable | aggregateInPlaceBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator)
Applies an aggregate procedure over the iterable grouping results into a Map based on the specific groupBy function. |
| public boolean | allSatisfy(Predicate<? super T> predicate)
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)
Returns true if the predicate evaluates to true for every element of the collection, or returns false. |
| public boolean | anySatisfy(Predicate<? super T> predicate)
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)
Returns true if the predicate evaluates to true for any element of the collection, or return false. |
| public default void | appendString(Appendable appendable)
Prints a string representation of this collection onto the given |
| public default void | appendString(Appendable appendable, String separator)
Prints a string representation of this collection onto the given |
| public void | appendString(Appendable appendable, String start, String separator, String end)
Prints a string representation of this collection onto the given |
| public LazyIterable | asLazy()
Returns a lazy (deferred) iterable, most likely implemented by calling LazyIterate.adapt(this). |
| public RichIterable | Returns: ARichIterable containing RichIterables of size size, except the last will be
truncated if the elements don't divide evenly.the number of elements per chunk size)Partitions elements in fixed size chunks. |
| public <V> RichIterable | |
| public <V, R extends Collection | Returns: target, which contains appended elements as a result of the collect transformationa function, R Function to use as the collect transformation functionthe Collection to append to for all elements in this target)RichIterable that meet select criteria functionSame as |
| public BooleanIterable | collectBoolean(BooleanFunction<? super T> booleanFunction)
Returns a new primitive |
| public default <R extends MutableBooleanCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa booleanFunction, R BooleanFunction to use as the collect transformation functionthe MutableBooleanCollection to append to for all elements in this target)RichIterableSame as |
| public ByteIterable | collectByte(ByteFunction<? super T> byteFunction)
Returns a new primitive |
| public default <R extends MutableByteCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa byteFunction, R ByteFunction to use as the collect transformation functionthe MutableByteCollection to append to for all elements in this target)RichIterableSame as |
| public CharIterable | collectChar(CharFunction<? super T> charFunction)
Returns a new primitive |
| public default <R extends MutableCharCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa charFunction, R CharFunction to use as the collect transformation functionthe MutableCharCollection to append to for all elements in this target)RichIterableSame as |
| public DoubleIterable | collectDouble(DoubleFunction<? super T> doubleFunction)
Returns a new primitive |
| public default <R extends MutableDoubleCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa doubleFunction, R DoubleFunction to use as the collect transformation functionthe MutableDoubleCollection to append to for all elements in this target)RichIterableSame as |
| public FloatIterable | collectFloat(FloatFunction<? super T> floatFunction)
Returns a new primitive |
| public default <R extends MutableFloatCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa floatFunction, R FloatFunction to use as the collect transformation functionthe MutableFloatCollection to append to for all elements in this target)RichIterableSame as |
| public <V> RichIterable | |
| public <V, R extends Collection | Returns: targetCollection, which contains appended elements as a result of the collect criteria and transformationa predicate, Function<? super T, ? extends V> Predicate to use as the select criteriaa function, R Function to use as the collect transformation functionthe Collection to append to for all elements in this target)RichIterable that meet the collect criteria predicateSame as the collectIf method with two parameters but uses the specified target collection for the results. |
| public IntIterable | collectInt(IntFunction<? super T> intFunction)
Returns a new primitive |
| public default <R extends MutableIntCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa intFunction, R IntFunction to use as the collect transformation functionthe MutableIntCollection to append to for all elements in this target)RichIterableSame as |
| public LongIterable | collectLong(LongFunction<? super T> longFunction)
Returns a new primitive |
| public default <R extends MutableLongCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa longFunction, R LongFunction to use as the collect transformation functionthe MutableLongCollection to append to for all elements in this target)RichIterableSame as |
| public ShortIterable | collectShort(ShortFunction<? super T> shortFunction)
Returns a new primitive |
| public default <R extends MutableShortCollection> R | Returns: target, which contains appended elements as a result of the collect transformationa shortFunction, R ShortFunction to use as the collect transformation functionthe MutableShortCollection to append to for all elements in this target)RichIterableSame as |
| public <P, V> RichIterable | Returns: A newRichIterable that contains the transformed elements returned by Function2#value(Object, Object)A function, P Function2 to use as the collect transformation functionA parameter to pass in for evaluation of the second argument parameter)P in functionSame as |
| public <P, V, R extends Collection | Returns: targetCollection, which contains appended elements as a result of the collect transformationa function, P Function2 to use as the collect transformation functiona parameter to pass in for evaluation of the second argument parameter, R P in functionthe Collection to append to for all elements in this targetCollection)RichIterable that meet select criteria functionSame as collectWith but with a targetCollection parameter to gather the results. |
| public boolean | |
| public boolean | containsAll(Collection<?> source)
Returns true if all elements in source are contained in this collection. |
| public boolean | containsAllArguments(Object... elements)
Returns true if all elements in the specified var arg array are contained in this collection. |
| public boolean | containsAllIterable(Iterable<?> source)
Returns true if all elements in source are contained in this collection. |
| public default boolean | containsAny(Collection<?> source)
Returns true if any of the elements in source is contained in this collection. |
| public default boolean | containsAnyIterable(Iterable<?> source)
Returns true if any of the elements in source is contained in this collection. |
| public default <V> boolean | containsBy(Function<? super T, ? extends V> function, V value)
Returns true if the iterable has an element which responds true to element.equals(value) after applying the specified function to the element. |
| public default boolean | containsNone(Collection<?> source)
Returns true if none of the elements in source are contained in this collection. |
| public default boolean | containsNoneIterable(Iterable<?> source)
Returns true if none of the elements in source are contained in this collection. |
| public int | |
| public default <V> Bag | |
| public default <V, R extends MutableBagIterable | |
| public default <V> Bag | countByEach(Function<? super T, ? extends Iterable<V>> function)
This method will count the number of occurrences of each value calculated by applying the function to each element of the collection. |
| public default <V, R extends MutableBagIterable | countByEach(Function<? super T, ? extends Iterable<V>> function, R target)
This method will count the number of occurrences of each value calculated by applying the function to each element of the collection. |
| public default <V, P> Bag | countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter)
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 default <V, P, R extends MutableBagIterable | countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter, R target)
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 <P> int | countWith(Predicate2<? super T, ? super P> predicate, P parameter)
Returns the total number of elements that evaluate to true for the specified predicate. |
| public T | |
| public default T | detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
Returns the first element of the iterable for which the predicate evaluates to true. |
| public Optional | detectOptional(Predicate<? super T> predicate)
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)
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)
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 | detectWithOptional(Predicate2<? super T, ? super P> predicate, P parameter)
Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional. |
| public void | |
| public <V> RichIterable | Returns: a new flattened collection produced by applying the givenfunctionThe function)Function to apply
|
| public <V, R extends Collection | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableBooleanCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableByteCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableCharCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableDoubleCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableFloatCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableIntCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableLongCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <R extends MutableShortCollection> R | Returns: target, which will contain a flattened collection of results produced by applying the given functionThe function, R Function to applyThe collection into which results should be added. target)Same as flatCollect, only the results are collected into the target collection. |
| public default <P, V> RichIterable | flatCollectWith(Function2<? super T, ? super P, ? extends Iterable<V>> function, P parameter)
Same as flatCollect, only with a Function2 that is passed an extra parameter. |
| public default <P, V, R extends Collection | flatCollectWith(Function2<? super T, ? super P, ? extends Iterable<V>> function, P parameter, R target)
Same as flatCollectWith, only the results are collected into the target collection. |
| public default void | forEach(Procedure<? super T> procedure)
Implements org. The procedure is executed for each element in the iterable. |
| public default T | |
| public T | getFirst()
Deprecated
in 6.0. Use
OrderedIterable#getFirst() instead.
Returns the first element of an iterable. |
| public T | getLast()
Deprecated
in 6.0. Use
OrderedIterable#getLast() instead.
Returns the last element of an iterable. |
| public default T | Returns: an element of an iterable.Returns the element if the iterable has exactly one element. |
| public <V> Multimap | groupBy(Function<? super T, ? extends V> function)
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 <V, R extends MutableMultimap | groupBy(Function<? super T, ? extends V> function, R target)
Same as |
| public default <K, V, R extends MutableMultimap | Returns: Thetarget collection where the key is the transformed result from applying the groupBy function
and the value is the transformed result from applying the collect function.a groupByFunction, Function<? super T, ? extends V> Function to use as the groupBy transformation functiona collectFunction, R target)Function to use as the collect transformation functionApplies a groupBy function over the iterable, followed by a collect function. |
| public <V> Multimap | groupByEach(Function<? super T, ? extends Iterable<V>> function)
Similar to |
| public <V, R extends MutableMultimap | groupByEach(Function<? super T, ? extends Iterable<V>> function, R target)
Same as |
| public <V> MapIterable | groupByUniqueKey(Function<? super T, ? extends V> function)
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 <V, R extends MutableMapIterable | groupByUniqueKey(Function<? super T, ? extends V> function, R target)
Same as |
| public <IV> IV | injectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function)
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)
Deprecated
since 11.1 - use injectIntoInt instead
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)
Deprecated
since 11.1 - use injectIntoLong instead
Returns the final long 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)
Deprecated
since 11.1 - use injectIntoFloat instead
Returns the final float 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)
Deprecated
since 11.1 - use injectIntoDouble instead
Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. |
| public default double | injectIntoDouble(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)
Returns the final double result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. |
| public default float | injectIntoFloat(float injectedValue, FloatObjectToFloatFunction<? super T> function)
Returns the final float result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. |
| public default int | injectIntoInt(int injectedValue, IntObjectToIntFunction<? super T> function)
Returns the final int result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. |
| public default long | injectIntoLong(long injectedValue, LongObjectToLongFunction<? super T> function)
Returns the final long result of evaluating function using each element of the iterable and the previous evaluation result as the parameters. |
| public <R extends Collection | |
| public boolean | |
| public default String | Returns: a string representation of this collection.Returns a string representation of this collection by delegating to |
| public default String | Returns: a string representation of this collection.Returns a string representation of this collection by delegating to |
| public default String | Returns: a string representation of this collection.Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings. |
| public default String | Returns: a string representation of the mapped collectionReturns a string representation of the collection, created by applying the function supplied to each element, with the elements separated by the specified separator and enclosed between the start and end strings. |
| public T | max(Comparator<? super T> comparator)
Returns the maximum element out of this container based on the comparator. |
| public T | |
| public <V extends Comparable | |
| public default <V extends Comparable | maxByOptional(Function<? super T, ? extends V> function)
Returns the maximum elements out of this container based on the natural order of the attribute returned by Function as an Optional. |
| public default Optional | maxOptional(Comparator<? super T> comparator)
Returns the maximum element out of this container based on the comparator as an Optional. |
| public default Optional | maxOptional()
Returns the maximum element out of this container based on the natural order as an Optional. |
| public T | min(Comparator<? super T> comparator)
Returns the minimum element out of this container based on the comparator. |
| public T | |
| public <V extends Comparable | |
| public default <V extends Comparable | minByOptional(Function<? super T, ? extends V> function)
Returns the minimum elements out of this container based on the natural order of the attribute returned by Function as an Optional. |
| public default Optional | minOptional(Comparator<? super T> comparator)
Returns the minimum element out of this container based on the comparator as an Optional. |
| public default Optional | minOptional()
Returns the minimum element out of this container based on the natural order as an Optional. |
| public boolean | noneSatisfy(Predicate<? super T> predicate)
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)
Returns true if the predicate evaluates to false for every element of the collection, or return false. |
| public default boolean | |
| public PartitionIterable | |
| public <P> PartitionIterable | partitionWith(Predicate2<? super T, ? super P> predicate, P parameter)
Filters a collection into a PartitionIterable based on the evaluation of the predicate. |
| public default Optional | reduce(BinaryOperator<T> accumulator)
This method produces the equivalent result as |
| public default <K> MapIterable | |
| public default <K, R extends MutableMapIterable | |
| public default <R, A> R | reduceInPlace(Collector<? super T, A, R> collector)
This method produces the equivalent result as |
| public default <R> R | reduceInPlace(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator)
This method produces the equivalent result as |
| public RichIterable | Returns: a RichIterable that contains elements that causePredicate#accept(Object) method to evaluate to falsea predicate)Predicate to use as the reject criteriaReturns all elements of the source collection that return false when evaluating of the predicate. |
| public <R extends Collection | Returns: target, which contains appended elements as a result of the reject criteriaa predicate, R Predicate to use as the reject criteriathe Collection to append to for all elements in this target)RichIterable that cause Predicate#accept(Object) method to evaluate to falseSame as the reject method with one parameter but uses the specified target collection for the results. |
| public <P> RichIterable | rejectWith(Predicate2<? super T, ? super P>
a predicate, P Predicate2 to use as the select criteriaa parameter to pass in for evaluation of the second argument parameter)P in predicateSimilar to |
| public <P, R extends Collection | Returns: targetCollection, which contains appended elements as a result of the reject criteriaa predicate, P Predicate2 to use as the reject criteriaa parameter to pass in for evaluation of the second argument parameter, R P in predicatethe Collection to append to for all elements in this targetCollection)RichIterable that cause Predicate#accept(Object) method to evaluate to falseSimilar to |
| public RichIterable | |
| public <R extends Collection | Returns: target, which contains appended elements as a result of the select criteriaa predicate, R Predicate to use as the select criteriathe Collection to append to for all elements in this target)RichIterable that meet select criteria predicateSame as the select method with one parameter but uses the specified target collection for the results. |
| public <S> RichIterable | selectInstancesOf(Class<S> clazz)
Returns all elements of the source collection that are instances of the Class |
| public <P> RichIterable | selectWith(Predicate2<? super T, ? super P>
a predicate, P Predicate2 to use as the select criteriaa parameter to pass in for evaluation of the second argument parameter)P in predicateSimilar to |
| public <P, R extends Collection | Returns: targetCollection, which contains appended elements as a result of the select criteriaa predicate, P Predicate2 to use as the select criteriaa parameter to pass in for evaluation of the second argument parameter, R P in predicatethe Collection to append to for all elements in this targetCollection)RichIterable that meet select criteria predicateSimilar to |
| public int | |
| public <V> ObjectDoubleMap | sumByDouble(Function<? super T, ? extends V> groupBy, DoubleFunction<? super T> function)
Groups and sums the values using the two specified functions. |
| public <V> ObjectDoubleMap | sumByFloat(Function<? super T, ? extends V> groupBy, FloatFunction<? super T> function)
Groups and sums the values using the two specified functions. |
| public <V> ObjectLongMap | sumByInt(Function<? super T, ? extends V> groupBy, IntFunction<? super T> function)
Groups and sums the values using the two specified functions. |
| public <V> ObjectLongMap | sumByLong(Function<? super T, ? extends V> groupBy, LongFunction<? super T> function)
Groups and sums the values using the two specified functions. |
| public default DoubleSummaryStatistics | summarizeDouble(DoubleFunction<? super T> function)
Returns the result of summarizing the value returned from applying the DoubleFunction to each element of the iterable. |
| public default DoubleSummaryStatistics | summarizeFloat(FloatFunction<? super T> function)
Returns the result of summarizing the value returned from applying the FloatFunction to each element of the iterable. |
| public default IntSummaryStatistics | summarizeInt(IntFunction<? super T> function)
Returns the result of summarizing the value returned from applying the IntFunction to each element of the iterable. |
| public default LongSummaryStatistics | summarizeLong(LongFunction<? super T> function)
Returns the result of summarizing the value returned from applying the LongFunction to each element of the iterable. |
| public double | sumOfDouble(DoubleFunction<? super T> function)
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)
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)
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)
Returns the final long result of evaluating function for each element of the iterable and adding the results together. |
| public RichIterable | |
| public default Object[] | |
| public default <E> E[] | toArray(E[] array)
Converts this iterable to an array using the specified target array, assuming the target array is as long or longer than the iterable. |
| public MutableBag | |
| public <NK, NV> MutableBiMap | |
| public default ImmutableBag | |
| public default <NK, NV> ImmutableBiMap | toImmutableBiMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
Converts the collection to an immutable BiMap implementation using the specified key and value functions. |
| public default ImmutableList | |
| public default <NK, NV> ImmutableMap | toImmutableMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
Converts the collection to an ImmutableMap implementation using the specified key and value functions. |
| public default ImmutableSet | |
| public default ImmutableSortedBag | |
| public default ImmutableSortedBag | toImmutableSortedBag(Comparator<? super T> comparator)
Converts the collection to an ImmutableSortedBag implementation and sorts it using the specified comparator. |
| public default <V extends Comparable | toImmutableSortedBagBy(Function<? super T, ? extends V> function)
Converts the collection to an ImmutableSortedBag implementation and sorts it based on the natural order of the
attribute returned by |
| public default ImmutableList | toImmutableSortedList()
Converts the RichIterable to the default sorted ImmutableList implementation. |
| public default ImmutableList | toImmutableSortedList(Comparator<? super T> comparator)
Converts the collection to an ImmutableList implementation and sorts it using the specified comparator. |
| public default <V extends Comparable | toImmutableSortedListBy(Function<? super T, ? extends V> function)
Converts the collection to an ImmutableList implementation and sorts it based on the natural order of the
attribute returned by |
| public default ImmutableSortedSet | |
| public default ImmutableSortedSet | toImmutableSortedSet(Comparator<? super T> comparator)
Converts the collection to an ImmutableSortedSet implementation and sorts it using the specified comparator. |
| public default <V extends Comparable | toImmutableSortedSetBy(Function<? super T, ? extends V> function)
Converts the collection to an ImmutableSortedSet implementation and sorts it based on the natural order of the
attribute returned by |
| public MutableList | |
| public <NK, NV> MutableMap | |
| public default <NK, NV, R extends Map | toMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction, R target)
Same as |
| public MutableSet | |
| public MutableSortedBag | toSortedBag()
Converts the collection to a MutableSortedBag implementation and sorts it using the natural order of the elements. |
| public MutableSortedBag | toSortedBag(Comparator<? super T> comparator)
Converts the collection to the MutableSortedBag implementation and sorts it using the specified comparator. |
| public default <V extends Comparable | toSortedBagBy(Function<? super T, ? extends V> function)
Converts the collection to a MutableSortedBag implementation and sorts it based on the natural order of the
attribute returned by |
| public default MutableList | toSortedList()
Converts the collection to a MutableList implementation and sorts it using the natural order of the elements. |
| public default MutableList | toSortedList(Comparator<? super T> comparator)
Converts the collection to a MutableList implementation and sorts it using the specified comparator. |
| public default <V extends Comparable | toSortedListBy(Function<? super T, ? extends V> function)
Converts the collection to a MutableList implementation and sorts it based on the natural order of the
attribute returned by |
| public <NK, NV> MutableSortedMap | toSortedMap(Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
Converts the collection to a MutableSortedMap implementation using the specified key and value functions sorted by the key elements' natural ordering. |
| public <NK, NV> MutableSortedMap | toSortedMap(Comparator<? super NK> comparator, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
Converts the collection to a MutableSortedMap implementation using the specified key and value functions sorted by the given comparator. |
| public default <KK extends Comparable | toSortedMapBy(Function<? super NK, KK> sortBy, Function<? super T, ? extends NK> keyFunction, Function<? super T, ? extends NV> valueFunction)
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 |
| public MutableSortedSet | toSortedSet()
Converts the collection to a MutableSortedSet implementation and sorts it using the natural order of the elements. |
| public MutableSortedSet | toSortedSet(Comparator<? super T> comparator)
Converts the collection to a MutableSortedSet implementation and sorts it using the specified comparator. |
| public default <V extends Comparable | toSortedSetBy(Function<? super T, ? extends V> function)
Converts the collection to a MutableSortedSet implementation and sorts it based on the natural order of the
attribute returned by |
| public String | Returns: a string representation of this RichIterableReturns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets. |
| public < the type of the second half of the returned pairs S> RichIterable | Returns: A newRichIterable containing pairs consisting of corresponding elements of this RichIterable and that. The length of the returned RichIterable is the minimum of the lengths of
this RichIterable and that.The that)RichIterable providing the second half of each result pair
Deprecated
in 6.0. Use
OrderedIterable#zip(Iterable) instead.
Returns a |
| public <S, R extends Collection | zip(Iterable<S> that, R target)
Deprecated
in 6.0. Use
OrderedIterable#zip(Iterable, Collection) instead;
Same as |
| public RichIterable | Returns: A newRichIterable containing pairs consisting of all elements of this RichIterable
paired with their index. Indices start at 0.
Deprecated
in 6.0. Use
OrderedIterable#zipWithIndex() instead.
Zips this |
| public <R extends Collection | zipWithIndex(R target)
Deprecated
in 6.0. Use
OrderedIterable#zipWithIndex(Collection) instead.
Same as |