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

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

/**
 * Created by wizzardo on 16.04.16.
 */
public class FlowFirst<A> extends FlowProcessor<A, A> {
    private A first;

    public FlowFirst(A def) {
        first = def;
    }

    @Override
    public void process(A a) {
        first = a;
        stop();
        onEnd();
    }

    @Override
    public A get() {
        return first;
    }
}

@@ -49,67 +49,8 @@
 s;%0A%0A
-import com.wizzardo.tools.collections.flow.FlowProcessor;%0A%0A
 /**%0A
@@ -138,18 +138,21 @@
 cess
-or
+OnEnd
 %3CA, A%3E %7B
 %0A   
@@ -151,29 +151,8 @@
 A%3E %7B
-%0A    private A first;
 %0A%0A  
@@ -183,28 +183,29 @@
 ) %7B%0A        
-firs
+resul
 t = def;%0A   
@@ -261,20 +261,21 @@
         
-firs
+resul
 t = a;%0A 
@@ -315,71 +315,7 @@
    %7D
-%0A%0A    @Override%0A    public A get() %7B%0A        return first;%0A    %7D
 %0A%7D%0A

update 'first'