package com.wizzardo.tools.collections.flow.flows;

import com.wizzardo.tools.collections.flow.FlowProcessor;

/**
 * Created by wizzardo on 11/05/16.
 */
public abstract class FlowProcessOnEnd<A, B> extends FlowProcessor<A, B> {
    @Override
    protected void onEnd() {
        FlowProcessor<B, ?> child = this.child;
        if (child != null) {
            child.process(get());
            onEnd(child);
        }
    }
}

@@ -223,16 +223,80 @@
 A, B%3E %7B%0A
+    protected boolean started = false;%0A    protected B result;%0A%0A
     @Ove
@@ -482,11 +482,232 @@
  %7D%0A    %7D
+%0A%0A    @Override%0A    protected void start() %7B%0A        if (!started) %7B%0A            started = true;%0A            super.start();%0A        %7D%0A    %7D%0A%0A    @Override%0A    public B get() %7B%0A        start();%0A        return result;%0A    %7D
 %0A%7D%0A

simplify api for 'finish' flows