Interface IteratorModule


interface IteratorModule
  • Method Details

    • duplicate

      static <T> Tuple2<Iterator<T>,Iterator<T>> duplicate(Iterator<T> iterator)
      Creates two new iterators that both iterates over the same elements as this iterator and in the same order. The duplicate iterators are considered equal if they are positioned at the same element.

      Given that most methods on iterators will make the original iterator unfit for further use, this methods provides a reliable way of calling multiple such methods on an iterator.

      Returns:
      a pair of iterators