Package org.nasengolem.util.zip
Class Zip<T extends org.jooq.lambda.tuple.Tuple>
java.lang.Object
org.nasengolem.util.zip.Zip<T>
- Type Parameters:
T
- the type of elements returned by this iterator.
public abstract class Zip<T extends org.jooq.lambda.tuple.Tuple>
extends Object
implements Iterator<T>, Iterable<T>
Abstract base class for implementing zipping functionality over multiple iterables.
This class implements both
Iterator
and Iterable
, allowing instances to be used
in enhanced for-loops and to provide their own iteration behavior.
The term "zipping" refers to combining multiple iterables into a single iterable of tuples.
Since Java does not natively support tuples or pattern matching, this implementation uses tuples
from the org.jooq.lambda.tuple
package to fill that gap.
This is inspired by the zip
function in Python.
For more information on the Python equivalent, see Python zip documentation.
- Author:
- Paul Steinbach
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Constructor Details
-
Zip
public Zip()
-
-
Method Details
-
iterator
-