com.softicar.platform.common.container.iterable.CastingIterable 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;
import com.softicar.platform.common.container.filter.FilteringIterator;
import com.softicar.platform.common.container.iterator.MappingIterator;
import java.util.Iterator;
/**
* An {@link Iterable} that filters and casts the elements of another
* {@link Iterable}.
*
* @author Oliver Richers
*/
public class CastingIterable implements Iterable {
private final Iterable iterable;
private final Class targetClass;
public CastingIterable(Iterable iterable, Class targetClass) {
this.iterable = iterable;
this.targetClass = targetClass;
}
@Override
public Iterator iterator() {
FilteringIterator