org.apache.tinkerpop.gremlin.util.iterator

## 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 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 <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> S` | `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)` Construct a `Stream` from an `Iterator`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### of

          public static final <S> Iterator<S> of(S a)

    - #### of

          public static final <S> Iterator<S> of(S a,
                                                 S b)

    - #### fill

          public static final <S extends Collection<T>,T> S fill(Iterator<T> iterator,
                                                                 S collection)

    - #### iterate

          public static void iterate(Iterator iterator)

    - #### count

          public static final long count(Iterator iterator)

    - #### count

          public static final long count(Iterable iterable)

    - #### list

          public static <S> List<S> list(Iterator<S> iterator)

    - #### list

          public static <S> List<S> list(Iterator<S> iterator,
                                         Comparator comparator)

    - #### set

          public static <S> Set<S> set(Iterator<S> iterator)

    - #### limit

          public static <S> Iterator<S> limit(Iterator<S> iterator,
                                              int limit)

    - #### allMatch

          public static <T> boolean allMatch(Iterator<T> iterator,
                                             Predicate<T> predicate)

    - #### anyMatch

          public static <T> boolean anyMatch(Iterator<T> iterator,
                                             Predicate<T> predicate)

    - #### noneMatch

          public static <T> boolean noneMatch(Iterator<T> iterator,
                                              Predicate<T> predicate)

    - #### collectMap

          public static <K,S> Map<K,S> collectMap(Iterator<S> iterator,
                                                  Function<S,K> key)

    - #### collectMap

          public static <K,S,V> Map<K,V> collectMap(Iterator<S> iterator,
                                                    Function<S,K> key,
                                                    Function<S,V> value)

    - #### groupBy

          public static <K,S> Map<K,List<S>> groupBy(Iterator<S> iterator,
                                                     Function<S,K> groupBy)

    - #### 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)

    - #### consume

          public static final <S> Iterator<S> consume(Iterator<S> iterator,
                                                      Consumer<S> consumer)

    - #### consume

          public static final <S> Iterable<S> consume(Iterable<S> iterable,
                                                      Consumer<S> consumer)

    - #### map

          public static final <S,E> Iterator<E> map(Iterator<S> iterator,
                                                    Function<S,E> function)

    - #### map

          public static final <S,E> Iterable<E> map(Iterable<S> iterable,
                                                    Function<S,E> function)

    - #### filter

          public static final <S> Iterator<S> filter(Iterator<S> iterator,
                                                     Predicate<S> predicate)

    - #### filter

          public static final <S> Iterable<S> filter(Iterable<S> iterable,
                                                     Predicate<S> predicate)

    - #### flatMap

          public static final <S,E> Iterator<E> flatMap(Iterator<S> iterator,
                                                        Function<S,Iterator<E>> function)

    - #### concat

          public static final <S> Iterator<S> concat(Iterator<S>... iterators)

    - #### asIterator

          public static Iterator asIterator(Object o)

    - #### asList

          public static List asList(Object o)

    - #### stream

          public static <T> Stream<T> stream(Iterator<T> iterator)

      Construct a `Stream` from an `Iterator`.

    - #### stream

          public static <T> Stream<T> stream(Iterable<T> iterable)

    - #### noRemove

          public static <T> Iterator<T> noRemove(Iterator<T> iterator)

    - #### removeOnNext

          public static <T> Iterator<T> removeOnNext(Iterator<T> iterator)

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.