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

com.tinkerpop.pipes.sideeffect.SideEffectFunctionPipe Maven / Gradle / Ivy

Go to download

Pipes is a dataflow framework written in Java that enables the splitting, merging, filtering, and transformation of data from input to output. Computations are expressed using a combinator model and are evaluated in a memory-efficient, lazy fashion.

There is a newer version: 2.6.0
Show newest version
package com.tinkerpop.pipes.sideeffect;

import com.tinkerpop.pipes.AbstractPipe;
import com.tinkerpop.pipes.PipeFunction;

/**
 * SideEffectFunctionPipe will emit the incoming object, but compute the PipeFunction on S.
 * The result of the PipeFunction is not accounted for in the stream.
 *
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class SideEffectFunctionPipe extends AbstractPipe {

    private final PipeFunction sideEffectFunction;

    public SideEffectFunctionPipe(final PipeFunction sideEffectFunction) {
        this.sideEffectFunction = sideEffectFunction;
    }

    public S processNextStart() {
        final S s = this.starts.next();
        this.sideEffectFunction.compute(s);
        return s;
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy