Class BiIteration<L,R>

java.lang.Object
com.google.mu.util.stream.BiIteration<L,R>

public class BiIteration<L,R> extends Object
Similar to Iteration, but is used to iteratively generate() pairs into a lazy BiStream.
  • Constructor Details

    • BiIteration

      public BiIteration()
  • Method Details

    • generate

      public final BiIteration<L,R> generate(L left, R right)
      Generates the pair of left and right to the result BiStream.
      Since:
      8.1
    • yield

      @Deprecated public final BiIteration<L,R> yield(L left, R right)
      Deprecated.
      use generate(L, R) instead.
      Yields the pair of left and right to the result BiStream.
    • yield

      public final BiIteration<L,R> yield(Iteration.Continuation continuation)
      Yields to the result BiStream a recursive iteration or lazy side-effect wrapped in continuation.
    • iterate

      public final BiStream<L,R> iterate()
      Starts iteration over the yielded pairs.

      Because a BiIteration instance is stateful and mutable, iterate() can be called at most once per instance.

      Throws:
      IllegalStateException - if iterate() has already been called.
      Since:
      4.5