com.softicar.platform.common.container.iterable.recurse.RecurseIterable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.container.iterable.recurse;
import java.util.Iterator;
import java.util.function.Function;
/**
* An {@link Iterable} that iterates a hierarchy of {@link Iterable}s.
*
* @author Oliver Richers
*/
public class RecurseIterable implements Iterable {
private final Iterable iterable;
private final Function> recurseFunction;
public RecurseIterable(Iterable iterable, Function> recurseFunction) {
this.iterable = iterable;
this.recurseFunction = recurseFunction;
}
@Override
public Iterator iterator() {
return new RecurseIterator<>(iterable, recurseFunction);
}
}