public final class IteratorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
allMatch(Iterator<T> iterator,
Predicate<T> predicate) |
static <T> boolean |
anyMatch(Iterator<T> iterator,
Predicate<T> predicate) |
static Iterator |
asIterator(Object o) |
static List |
asList(Object o) |
static <S,E> Iterator<E> |
cast(Iterator<S> iterator) |
static <K,S> Map<K,S> |
collectMap(Iterator<S> iterator,
Function<S,K> key) |
static <K,S,V> Map<K,V> |
collectMap(Iterator<S> iterator,
Function<S,K> key,
Function<S,V> value) |
static <S> Iterator<S> |
concat(Iterator<S>... iterators) |
static <S> Iterable<S> |
consume(Iterable<S> iterable,
Consumer<S> consumer) |
static <S> Iterator<S> |
consume(Iterator<S> iterator,
Consumer<S> consumer) |
static long |
count(Iterable iterable) |
static long |
count(Iterator iterator) |
static <S extends Collection<T>,T> |
fill(Iterator<T> iterator,
S collection) |
static <S> Iterable<S> |
filter(Iterable<S> iterable,
Predicate<S> predicate) |
static <S> Iterator<S> |
filter(Iterator<S> iterator,
Predicate<S> predicate) |
static <S,E> Iterator<E> |
flatMap(Iterator<S> iterator,
Function<S,Iterator<E>> function) |
static <K,S> Map<K,List<S>> |
groupBy(Iterator<S> iterator,
Function<S,K> groupBy) |
static void |
iterate(Iterator iterator) |
static <S> Iterator<S> |
limit(Iterator<S> iterator,
int limit) |
static <S> List<S> |
list(Iterator<S> iterator) |
static <S> List<S> |
list(Iterator<S> iterator,
Comparator comparator) |
static <S,E> Iterable<E> |
map(Iterable<S> iterable,
Function<S,E> function) |
static <S,E> Iterator<E> |
map(Iterator<S> iterator,
Function<S,E> function) |
static <T> boolean |
noneMatch(Iterator<T> iterator,
Predicate<T> predicate) |
static <T> Iterator<T> |
noRemove(Iterator<T> iterator) |
static <S> Iterator<S> |
of(S a) |
static <S> Iterator<S> |
of(S a,
S b) |
static <S,E> E |
reduce(Iterable<S> iterable,
E identity,
BiFunction<E,S,E> accumulator) |
static <S> S |
reduce(Iterable<S> iterable,
S identity,
BinaryOperator<S> accumulator) |
static <S,E> E |
reduce(Iterator<S> iterator,
E identity,
BiFunction<E,S,E> accumulator) |
static <S> S |
reduce(Iterator<S> iterator,
S identity,
BinaryOperator<S> accumulator) |
static <T> Iterator<T> |
removeOnNext(Iterator<T> iterator) |
static <S> Set<S> |
set(Iterator<S> iterator) |
static <T> Stream<T> |
stream(Iterable<T> iterable) |
static <T> Stream<T> |
stream(Iterator<T> iterator)
|
public static final <S> Iterator<S> of(S a)
public static final <S> Iterator<S> of(S a, S b)
public static final <S extends Collection<T>,T> S fill(Iterator<T> iterator, S collection)
public static void iterate(Iterator iterator)
public static final long count(Iterator iterator)
public static final long count(Iterable iterable)
public static <S> List<S> list(Iterator<S> iterator, Comparator comparator)
public static <K,S,V> Map<K,V> collectMap(Iterator<S> iterator, Function<S,K> key, Function<S,V> value)
public static <S> S reduce(Iterator<S> iterator, S identity, BinaryOperator<S> accumulator)
public static <S> S reduce(Iterable<S> iterable, S identity, BinaryOperator<S> accumulator)
public static <S,E> E reduce(Iterator<S> iterator, E identity, BiFunction<E,S,E> accumulator)
public static <S,E> E reduce(Iterable<S> iterable, E identity, BiFunction<E,S,E> accumulator)
public static final <S,E> Iterator<E> flatMap(Iterator<S> iterator, Function<S,Iterator<E>> function)
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.