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

com.softicar.platform.common.container.filter.FilteringIterable Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.container.filter;

import java.util.Iterator;
import java.util.function.Predicate;

/**
 * An {@link Iterable} that filters elements of another {@link Iterable}.
 *
 * @author Oliver Richers
 */
public class FilteringIterable implements Iterable {

	private final Iterable iterable;
	private final Predicate predicate;

	public FilteringIterable(Iterable iterable, Predicate predicate) {

		this.iterable = iterable;
		this.predicate = predicate;
	}

	@Override
	public Iterator iterator() {

		return new FilteringIterator<>(iterable.iterator(), predicate);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy