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

com.tinkerpop.pipes.util.ExpandablePipe Maven / Gradle / Ivy

package com.tinkerpop.pipes.util;

import com.tinkerpop.pipes.AbstractPipe;

import java.util.LinkedList;
import java.util.Queue;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class ExpandablePipe extends AbstractPipe {

    protected Queue queue = new LinkedList();

    public S processNextStart() {
        if (!this.queue.isEmpty())
            return this.queue.remove();
        else
            return this.starts.next();
    }

    public void add(S s) {
        this.queue.add(s);
    }
}