package org.gcube.data.streams.generators; import org.gcube.data.streams.Stream; import org.gcube.data.streams.exceptions.StreamSkipSignal; /** * A {@link Filter} that changes the elements of the input {@link Stream}. * * @author Fabio Simeoni * * @param the type of input elements */ public abstract class Processor extends Filter { @Override public final E yield(E element) { process(element); return element; }; /** * Processes an element of a {@link Stream}. * * @param element the input element * @throws StreamSkipSignal if no element should be yielded from the input element (i.e. the element * should not contribute to the output stream) * @throws RuntimeException ion if no element can be yielded from the input element */ protected abstract void process(E element); }