Class BreadthFirstSearchIterator<T,​C extends Collection<T>>

  • Type Parameters:
    T - The node type
    C - The collection type of a breath
    All Implemented Interfaces:
    Iterator<C>

    public class BreadthFirstSearchIterator<T,​C extends Collection<T>>
    extends com.google.common.collect.AbstractIterator<C>
    Author:
    raven
    • Field Detail

      • successorFn

        protected java.util.function.Function<? super T,​? extends java.util.stream.Stream<? extends T>> successorFn
      • collectorSupplier

        protected java.util.function.Supplier<? extends java.util.stream.Collector<T,​?,​C extends Collection<T>>> collectorSupplier
      • seen

        protected Set<? super T> seen
    • Constructor Detail

      • BreadthFirstSearchIterator

        public BreadthFirstSearchIterator​(C current,
                                          java.util.function.Function<? super T,​? extends java.util.stream.Stream<? extends T>> successorFn,
                                          java.util.function.Supplier<? extends java.util.stream.Collector<T,​?,​C>> collectorSupplier)
    • Method Detail

      • computeNext

        protected C computeNext()
        Specified by:
        computeNext in class com.google.common.collect.AbstractIterator<C extends Collection<T>>