org.irlab.cartesianproduct.Iterator5 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.Tuple4;
import org.jooq.lambda.tuple.Tuple5;
/**
* Iterator for {@link Iterator5}
*
* @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
* @param the type of the fifth element
*
* @author [email protected]
*/
final class Iterator5
extends ProductIterator, E5, Tuple5> {
/**
* Creates a new instance.
*
* @param col1 the first collection
* @param col2 the second collection
* @param col3 the third collection
* @param col4 the forth collection
* @param col5 the fifth collection
*/
Iterator5(final Iterable col1, final Iterable col2, final Iterable col3,
final Iterable col4, final Iterable col5) {
super(() -> new Iterator4<>(col1, col2, col3, col4), col5);
}
/**
* {@inheritDoc}
*/
@Override
protected Tuple5 join(final Tuple4 e1, final E5 e2) {
return e1.concat(e2);
}
}