ZipIterator Reference
A ZipIterator zips two iterators together into a Pair. It inherits from Iterator.
Constructor
Section titled “Constructor”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);Parameters
Section titled “Parameters”first: Iterator - The first iterator in the pair.
second: Iterator - The second iterator in the pair.
Methods
Section titled “Methods”Inherited
Section titled “Inherited”All methods are inherited from the Iterator class. See the Iterator reference for documentation.
Example
Section titled “Example”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"