Class Iterables.UnfoldingIterable<A,​B>

  • All Implemented Interfaces:
    java.lang.Iterable<A>
    Enclosing class:
    Iterables

    static final class Iterables.UnfoldingIterable<A,​B>
    extends Iterables.IterableToString<A>
    Iterable that repeatedly applies f until it returns none()
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.function.Function<? super B,​Option<Pair<A,​B>>> f  
      private B seed  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private UnfoldingIterable​(java.util.function.Function<? super B,​Option<Pair<A,​B>>> f, B seed)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<A> iterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • f

        private final java.util.function.Function<? super B,​Option<Pair<A,​B>>> f
      • seed

        private final B seed
    • Constructor Detail

      • UnfoldingIterable

        private UnfoldingIterable​(java.util.function.Function<? super B,​Option<Pair<A,​B>>> f,
                                  B seed)
    • Method Detail

      • iterator

        public java.util.Iterator<A> iterator()