public class MoreIterables extends Object
Modifier and Type | Method and Description |
---|---|
static <T> Set<T> |
dedupKeepLast(Iterable<T> toDedup)
Returns a deduped version of toDedup and keeps the order of elements If a key is contained more
than once (that is, there are multiple elements e1, e2...
|
static <T> Iterable<Pair<Integer,T>> |
enumerate(Iterable<T> items) |
static <L,R> void |
forEachPair(Iterable<L> left,
Iterable<R> right,
java.util.function.BiConsumer<? super L,? super R> consumer)
Provides convenient consumption of a pair of Iterables of the same length.
|
static <T> Iterable<T> |
zipAndConcat(Iterable<T>... inputs)
Combine the given iterables by peeling off items one at a time from each of the input iterables
until any one of the iterables are exhausted.
|
@SafeVarargs public static <T> Iterable<T> zipAndConcat(Iterable<T>... inputs)
public static <L,R> void forEachPair(Iterable<L> left, Iterable<R> right, java.util.function.BiConsumer<? super L,? super R> consumer)
public static <T> Set<T> dedupKeepLast(Iterable<T> toDedup)