public <Z, V extends Flow<Z>> Flow<Z> flatMap(Mapper<? super B, ? extends V> mapper) { FlowContinue<Z> continueCommand = new FlowContinue<Z>(this); then(new FlowFlatMap<K, V, B, Z>(mapper, continueCommand)); return continueCommand; }
@Override public void run() { doInAsyncTask(); } }
@Override protected void onEnd() { result = count; super.onEnd(); } }
public FlowContinue(Flow<?> flow) { this.flow = flow; child = new FlowNoop<T>(); }
@Override protected void stop() { stopped = true; super.stop(); }
protected void doOnEnd() { if (child != null) onEnd(child); } }
@Override protected void onEnd() { endTask(); } }).execute();
@Override public Flow getLast() { return continueFlow.getLast(); } }
@Override public void process(A a) { stop(result = a); } }
public B orElse(B other) { B b = get(); return b != null ? b : other; }
@Override public void consume(T t) { flow.process(t); } };
public <Z, V extends Flow<Z>> Flow<Z> flatMap(Mapper<? super B, ? extends V> mapper) { FlowContinue<Z> continueCommand = new FlowContinue<Z>(this); then(new FlowFlatMap<K, V, B, Z>(mapper, continueCommand)); return continueCommand; }
@Override public void run() { doInAsyncTask(); } }
@Override protected void onEnd() { result = count; super.onEnd(); } }
public FlowGroup(K key) { this.key = key; child = new FlowNoop<T>(); }