public Pipe getPreviousPipe()

in src/main/java/org/apache/sling/pipes/SuperPipe.java [93:108]


    public Pipe getPreviousPipe(Pipe pipe){
        Pipe previousPipe = null;
        if (!subpipes.isEmpty()){
            if (subpipes.get(0).equals(pipe) && parent != null){
                //in the case this pipe has a parent, previous pipe is the one of the referrer
                return parent.getPreviousPipe(this);
            }
            for (Pipe candidate : subpipes){
                if (candidate.equals(pipe)){
                    return previousPipe;
                }
                previousPipe = candidate;
            }
        }
        return null;
    }