All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.daisy.dotify.common.collection.CompoundIterable Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package org.daisy.dotify.common.collection;

import java.util.Iterator;

/**
 * Provides a method to iterate over several iterables of the same type
 * as if the items were part of the same iterable.
 *
 * @param  the type of iterable
 * @author Joel Håkansson
 */
public class CompoundIterable implements Iterable {
    private final Iterable> iterables;

    /**
     * Creates a new compound iterable.
     *
     * @param iterables the iterables to use
     */
    public CompoundIterable(Iterable> iterables) {
        this.iterables = iterables;
    }

    @Override
    public Iterator iterator() {
        return new CompoundIterator<>(iterables);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy