Class IteratorUtils
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils
-
public final class IteratorUtils extends Object
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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 Set
asSet(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>
Sfill(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 <T> Optional<T>
findFirst(Iterator<T> iterator)
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> Iterable<S>
peek(Iterable<S> iterable, Consumer<S> function)
static <S> Iterator<S>
peek(Iterator<S> iterator, Consumer<S> function)
static <S,E>
Ereduce(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>
Ereduce(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)
-
-
-
Method Detail
-
of
public static <S> Iterator<S> of(S a)
-
of
public static <S> Iterator<S> of(S a, S b)
-
fill
public static <S extends Collection<T>,T> S fill(Iterator<T> iterator, S collection)
-
iterate
public static void iterate(Iterator iterator)
-
count
public static long count(Iterator iterator)
-
count
public static final long count(Iterable iterable)
-
list
public static <S> List<S> list(Iterator<S> iterator, Comparator comparator)
-
collectMap
public static <K,S,V> Map<K,V> collectMap(Iterator<S> iterator, Function<S,K> key, Function<S,V> value)
-
reduce
public static <S> S reduce(Iterator<S> iterator, S identity, BinaryOperator<S> accumulator)
-
reduce
public static <S> S reduce(Iterable<S> iterable, S identity, BinaryOperator<S> accumulator)
-
reduce
public static <S,E> E reduce(Iterator<S> iterator, E identity, BiFunction<E,S,E> accumulator)
-
reduce
public static <S,E> E reduce(Iterable<S> iterable, E identity, BiFunction<E,S,E> accumulator)
-
flatMap
public static <S,E> Iterator<E> flatMap(Iterator<S> iterator, Function<S,Iterator<E>> function)
-
-