package org.gcube.data.streams.dsl.fold; import org.gcube.data.streams.Stream; import org.gcube.data.streams.delegates.FoldedStream; import org.gcube.data.streams.dsl.StreamClause; import org.gcube.data.streams.dsl.StreamClauseEnv; /** * The clause of {@code fold} sentences in which a fold size is configured for * the output stream. * * @author Fabio Simeoni * * @param the type of stream elements */ public class InClause extends StreamClause> { /** * Creates an instance with an input {@link Stream}. * @param stream the stream */ public InClause(Stream stream) { super(new StreamClauseEnv(stream)); } /** * Returns a {@link Stream} that folds the element of the input {@link Stream} in lists of a given size. * @param foldSize the size * @return the stream */ public FoldedStream in(int foldSize) { return new FoldedStream(env.stream(),foldSize); } }