| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static <T> boolean | addAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection)
Add all elements from the source Iterable to the target collection, returns true if any element was added. |
| public static <T, R extends Collection | |
| public static <T, K, V, M extends Map | |
| public static <T, K, V, M extends Map | |
| public static <T, K, V> MutableMap | aggregateBy(Iterable<T> iterable, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator)
|
| public static <T, K, V> MutableMap | aggregateInPlaceBy(Iterable<T> iterable, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator)
|
| public static <T> boolean | allSatisfy(Iterable<T> iterable, Predicate<? super T> predicate)
Returns true if the predicate evaluates to true for every element of the iterable, or returns false. |
| public static <T, P> boolean | allSatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Returns true if the predicate evaluates to true for every element of the iterable, or returns false. |
| public static <T> boolean | anySatisfy(Iterable<T> iterable, Predicate<? super T> predicate)
Returns true if the predicate evaluates to true for any element of the iterable. |
| public static <T, P> boolean | anySatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Returns true if the predicate2 and parameter evaluates to true for any element of the iterable. |
| public static <T> void | |
| public static <T> void | |
| public static <T> void | appendString(Iterable<T> iterable, Appendable appendable, String start, String separator, String end)
|
| public static <T> RichIterable | |
| public static <T, V> Collection | |
| public static <T, A, R extends Collection | collect(Iterable<T> iterable, Function<? super T, ? extends A> function, R targetCollection)
Same as the Example using a Java 8 lambda expression:
MutableList<String> names =
Iterate.
|
| public static <T> MutableBooleanCollection | collectBoolean(Iterable<T> iterable, BooleanFunction<? super T> booleanFunction)
Returns a new primitive |
| public static <T, R extends MutableBooleanCollection> R | collectBoolean(Iterable<T> iterable, BooleanFunction<? super T> booleanFunction, R target)
Same as |
| public static <T> MutableByteCollection | collectByte(Iterable<T> iterable, ByteFunction<? super T> byteFunction)
Returns a new |
| public static <T, R extends MutableByteCollection> R | collectByte(Iterable<T> iterable, ByteFunction<? super T> byteFunction, R target)
Same as |
| public static <T> MutableCharCollection | collectChar(Iterable<T> iterable, CharFunction<? super T> charFunction)
Returns a new |
| public static <T, R extends MutableCharCollection> R | collectChar(Iterable<T> iterable, CharFunction<? super T> charFunction, R target)
Same as |
| public static <T> MutableDoubleCollection | collectDouble(Iterable<T> iterable, DoubleFunction<? super T> doubleFunction)
Returns a new |
| public static <T, R extends MutableDoubleCollection> R | collectDouble(Iterable<T> iterable, DoubleFunction<? super T> doubleFunction, R target)
Same as |
| public static <T> MutableFloatCollection | collectFloat(Iterable<T> iterable, FloatFunction<? super T> floatFunction)
Returns a new |
| public static <T, R extends MutableFloatCollection> R | collectFloat(Iterable<T> iterable, FloatFunction<? super T> floatFunction, R target)
Same as |
| public static <T, V> Collection | |
| public static <T, V, R extends Collection | |
| public static <T> MutableIntCollection | collectInt(Iterable<T> iterable, IntFunction<? super T> intFunction)
Returns a new |
| public static <T, R extends MutableIntCollection> R | collectInt(Iterable<T> iterable, IntFunction<? super T> intFunction, R target)
Same as |
| public static <T> MutableLongCollection | collectLong(Iterable<T> iterable, LongFunction<? super T> longFunction)
Returns a new |
| public static <T, R extends MutableLongCollection> R | collectLong(Iterable<T> iterable, LongFunction<? super T> longFunction, R target)
Same as |
| public static <T> MutableShortCollection | collectShort(Iterable<T> iterable, ShortFunction<? super T> shortFunction)
Returns a new |
| public static <T, R extends MutableShortCollection> R | collectShort(Iterable<T> iterable, ShortFunction<? super T> shortFunction, R target)
Same as |
| public static <T, P, A> Collection | collectWith(Iterable<T> iterable, Function2<? super T, ? super P, ? extends A> function, P parameter)
Same as collect with a Function2 and specified parameter which is passed to the function. |
| public static <T, P, A, R extends Collection | collectWith(Iterable<T> iterable, Function2<? super T, ? super P, ? extends A> function, P parameter, R targetCollection)
Same as collectWith but with a targetCollection parameter to gather the results. |
| public static boolean | |
| public static <T> int | |
| public static <T, IV> int | countWith(Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue)
Returns the total number of elements that evaluate to true for the specified predicate2 and parameter. |
| public static <T> T | |
| public static <T> T | detectIfNone(Iterable<T> iterable, Predicate<? super T> predicate, T ifNone)
Returns the first element of the iterable that evaluates to true for the specified predicate, or returns the result ifNone if no element evaluates to true. |
| public static <T> int | detectIndex(Iterable<T> iterable, Predicate<? super T> predicate)
Searches for the first occurrence where the predicate evaluates to true, returns -1 if the predicate does not evaluate to true. |
| public static <T, P> int | detectIndexWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Searches for the first occurrence where the predicate2 and parameter evaluates to true, returns -1 if the predicate2 and parameter do not evaluate to true. |
| public static <T> Optional | detectOptional(Iterable<T> iterable, Predicate<? super T> predicate)
Returns the first element of the iterable that evaluates to true for the specified predicate as an Optional. |
| public static <T, P> T | detectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Returns the first element of the iterable that evaluates to true for the specified predicate2 and parameter, or null if no element evaluates to true. |
| public static <T, P> T | detectWithIfNone(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter, T ifNone)
Returns the first element of the iterable that evaluates to true for the specified predicate2 and parameter, or returns the result ifNone if no element evaluates to true. |
| public static <T, P> Optional | detectWithOptional(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Returns the first element of the iterable that evaluates to true for the specified predicate2 and parameter as an Optional. |
| public static <T> Collection | Returns: a new list with the items dropped from the given collection.the collection to drop from. iterable, int the number of items to drop. count)Returns a collection without the first |
| public static <T, V> Collection | |
| public static <T, A, R extends Collection | flatCollect(Iterable<T> iterable, Function<? super T, ? extends Iterable<A>> function, R targetCollection)
|
| public static <T> Collection | |
| public static <T, R extends Collection | flatten(Iterable<? extends Iterable<T>> iterable, R targetCollection)
Same as |
| public static <K, V> HashBagMultimap | |
| public static <K, V> HashBagMultimap | |
| public static <K, V> UnifiedSetMultimap | |
| public static <T> void | |
| public static <T, P> void | forEachWith(Iterable<T> iterable, Procedure2<? super T, ? super P> procedure, P parameter)
The procedure2 is evaluated for each element of the iterable with the specified parameter passed as the second argument. |
| public static <T> void | forEachWithIndex(Iterable<T> iterable, ObjectIntProcedure<? super T> objectIntProcedure)
Iterates over a collection passing each element and the current relative int index to the specified instance of ObjectIntProcedure. |
| public static <T> T | |
| public static <T> T | |
| public static <T> T | |
| public static <T, V> MutableMultimap | |
| public static <T, V, R extends MutableMultimap | |
| public static <T, K, V, R extends MutableMultimap | groupByAndCollect(Iterable<T> iterable, Function<? super T, ? extends K> groupByFunction, Function<? super T, ? extends V> valueFunction, R targetMultimap)
Iterate over the specified collection applying the specified Functions to each element to calculate
a key and value, add the results to |
| public static <T, V> MutableMultimap | |
| public static <T, V, R extends MutableMultimap | groupByEach(Iterable<T> iterable, Function<? super T, ? extends Iterable<V>> function, R targetCollection)
|
| public static <V, T> MutableMap | |
| public static <V, T, R extends MutableMapIterable | |
| public static <T, IV> IV | injectInto(IV injectValue, Iterable<T> iterable, Function2<? super IV, ? super T, ? extends IV> function)
|
| public static <T> int | |
| public static <T> long | |
| public static <T> double | injectInto(double injectValue, Iterable<T> iterable, DoubleObjectToDoubleFunction<? super T> function)
|
| public static <T> float | |
| public static <T, IV, P> IV | injectIntoWith(IV injectValue, Iterable<T> iterable, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter)
Similar to |
| public static boolean | |
| public static <T> String | |
| public static <T> String | |
| public static <T> String | |
| public static <T> T | |
| public static <T> T | |
| public static <T, V extends Comparable | |
| public static <T> T | |
| public static <T> T | |
| public static <T, V extends Comparable | |
| public static <T> boolean | noneSatisfy(Iterable<T> iterable, Predicate<? super T> predicate)
Returns true if the predicate evaluates to false for every element of the iterable, or returns false. |
| public static <T, P> boolean | noneSatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Returns true if the predicate evaluates to false for every element of the iterable, or returns false. |
| public static boolean | |
| public static <T> PartitionIterable | |
| public static <T, P> PartitionIterable | partitionWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Filters a collection into a PartitionIterable based on a predicate. |
| public static <T, A, R> R | reduceInPlace(Iterable<T> iterable, Collector<? super T, A, R> collector)
This method produces the equivalent result as |
| public static <T, R> R | reduceInPlace(Iterable<T> iterable, Supplier<R> supplier, BiConsumer<R, ? super T> accumulator)
This method produces the equivalent result as |
| public static <T> Collection | |
| public static <T, R extends Collection | |
| public static <T, P> Collection | rejectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Similar to |
| public static <T, P, R extends Collection | rejectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter, R targetCollection)
Same as the reject method with two parameters but uses the specified target collection. |
| public static <T, R extends Collection | removeAllFrom(Iterable<? extends T> iterable, R targetCollection)
Remove all elements present in Iterable from the target collection, return the target collection. |
| public static <T> boolean | removeAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection)
Remove all elements present in Iterable from the target collection, returns true if any element was removed. |
| public static <T> boolean | |
| public static <T, P> boolean | removeIfWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)
Removes all elements of the iterable that evaluate to true for the specified predicate2 and parameter. |
| public static <T> Collection | |
| public static <T, R extends Collection | |
| public static <T, IV> Twin | selectAndRejectWith(Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue)
Filters a collection into two separate collections based on a predicate returned via a Twin. |
| public static <T> Collection | selectInstancesOf(Iterable<?> iterable, Class<T> clazz)
Returns a new collection with only the elements that are instances of the Class |
| public static <T, IV> Collection | selectWith(Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV parameter)
Returns a new collection with only elements that evaluated to true for the specified predicate and parameter. |
| public static <T, P, R extends Collection | selectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter, R targetCollection)
Same as the selectWith method with two parameters but uses the specified target collection. |
| public static int | |
| public static <T extends Comparable | |
| public static <T, L extends List | |
| public static <T, L extends List | |
| public static <T, V extends Comparable | sortThisBy(L list, Function<? super T, ? extends V> function)
Sort the list by comparing an attribute defined by the function. |
| public static <V, T> MutableMap | sumByBigDecimal(Iterable<T> iterable, Function<T, V> groupBy, Function<? super T, BigDecimal> function)
Groups and sums the values of the iterable using the two specified functions. |
| public static <V, T> MutableMap | sumByBigInteger(Iterable<T> iterable, Function<T, V> groupBy, Function<? super T, BigInteger> function)
Groups and sums the values of the iterable using the two specified functions. |
| public static <T, V> ObjectDoubleMap | |
| public static <T, V> ObjectDoubleMap | |
| public static <T, V> ObjectLongMap | |
| public static <T, V> ObjectLongMap | |
| public static <T> BigDecimal | sumOfBigDecimal(Iterable<T> iterable, Function<? super T, BigDecimal> function)
Returns the BigDecimal sum of the result of applying the function to each element of the iterable. |
| public static <T> BigInteger | sumOfBigInteger(Iterable<T> iterable, Function<? super T, BigInteger> function)
Returns the BigInteger sum of the result of applying the function to each element of the iterable. |
| public static <T> double | |
| public static <T> double | |
| public static <T> long | |
| public static <T> long | |
| public static <T> Collection | |
| public static <T> Object[] | |
| public static <T> T[] | |
| public static <T, K> MutableMap | |
| public static <T, K, V> MutableMap | |
| public static <T, K, V, R extends Map | toMap(Iterable<T> iterable, Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction, R target)
Iterate over the specified collection applying the specified Functions to each element to calculate a key and value, and return the results in the specified Map instance. |
| public static <T, K, V, R extends MutableMultimap | toMultimap(Iterable<T> iterable, Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends Iterable<V>> valuesFunction, R targetMultimap)
Iterate over the specified collection applying the specified Functions to each element to calculate
a key and values, add the results to |
| public static <T extends Comparable | |
| public static <T> MutableList | toSortedList(Iterable<T> iterable, Comparator<? super T> comparator)
Return the specified collection as a sorted List using the specified Comparator. |
| public static <X, Y> Collection | |
| public static <X, Y, R extends Collection | |
| public static <T> Collection | |
| public static <T, R extends Collection |