Class IteratorModule.GroupedIterator<T>

java.lang.Object
io.vavr.collection.IteratorModule.GroupedIterator<T>
All Implemented Interfaces:
Foldable<Seq<T>>, Iterator<Seq<T>>, Traversable<Seq<T>>, Value<Seq<T>>, Iterable<Seq<T>>, Iterator<Seq<T>>
Enclosing interface:
IteratorModule

public static final class IteratorModule.GroupedIterator<T> extends Object implements Iterator<Seq<T>>
  • Field Details

    • that

      private final Iterator<T> that
    • size

      private final int size
    • step

      private final int step
    • gap

      private final int gap
    • preserve

      private final int preserve
    • buffer

      private Object[] buffer
  • Constructor Details

    • GroupedIterator

      GroupedIterator(Iterator<T> that, int size, int step)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public Seq<T> next()
      Specified by:
      next in interface Iterator<T>
    • drop

      private static void drop(Iterator<?> source, int count)
    • take

      private static Object[] take(Iterator<?> source, Object[] target, int offset, int count)