Skip to content

ZipIterator Reference

A ZipIterator zips two iterators together into a Pair. It inherits from Iterator.

Creates an iterator to zip with another iterator.

var iterator = ArrayIterator([0, 1, 2]);
var other_iterator = ArrayIterator([3, 4, 5]);
var combined_iterators = ZipIterator(iterator, other_iterator);

first: Iterator - The first iterator in the pair.

second: Iterator - The second iterator in the pair.

All methods are inherited from the Iterator class. See the Iterator reference for documentation.

var iterator = ArrayIterator([0, 1, 2]);
var other_iterator = ArrayIterator([3, 4, 5]);
ZipIterator(iterator, other_iterator).for_each((pair) -> {
println("Left: " + to_string(pair.left) + " Right: " + to_string(pair.right));
});
// "Left: 0, Right: 3"
// "Left: 1, Right: 4"
// "Left: 2, Right: 5"