org.irlab.cartesianproduct.Iterator4 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cartesian-product Show documentation
Show all versions of cartesian-product Show documentation
Iterable of the cartesian product of Iterables
The newest version!
/*
* Copyright 2019 Information Retrieval Lab - University of A Coruña
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.irlab.cartesianproduct;
import org.jooq.lambda.tuple.Tuple3;
import org.jooq.lambda.tuple.Tuple4;
/**
* Iterator for {@link Iterator4}
*
* @param the type of the first element
* @param the type of the first element
* @param the type of the third element
* @param the type of the fourth element
*
* @author [email protected]
*/
final class Iterator4
extends ProductIterator, E4, Tuple4> {
/**
* Creates a new instance.
*
* @param col1 the first collection
* @param col2 the second collection
* @param col3 the third collection
* @param col4 the forth collection
*/
Iterator4(final Iterable col1, final Iterable col2, final Iterable col3,
final Iterable col4) {
super(() -> new Iterator3<>(col1, col2, col3), col4);
}
/**
* {@inheritDoc}
*/
@Override
protected Tuple4 join(final Tuple3 e1, final E4 e2) {
return e1.concat(e2);
}
}