RxJava 操作符 concat
来源:互联网 发布:2017年mac游戏推荐 编辑:程序博客网 时间:2024/05/16 23:35
Concat操作符
public void test() { Observable.concat(Observable.just("a"), Observable.just("b"), Observable.just("c")).subscribe( new Observer<String>() { @Override public void onCompleted() { Log.e("test---onCompleted ", "onCompleted"); } @Override public void onError(Throwable e) { } @Override public void onNext(String s) { Log.e("test---onNext ", "onNext s : " + s); } }); }
04-22 16:44:43.822 28030-28030/com.fernandocejas.android10.sample.presentation E/test---onNext﹕ onNext s : a04-22 16:44:43.822 28030-28030/com.fernandocejas.android10.sample.presentation E/test---onNext﹕ onNext s : b04-22 16:44:43.822 28030-28030/com.fernandocejas.android10.sample.presentation E/test---onNext﹕ onNext s : c04-22 16:44:43.822 28030-28030/com.fernandocejas.android10.sample.presentation E/test---onCompleted﹕ onCompleted
可以将该操作符看作,依次将多个数据源释放到同一个地方。
/** * Returns an Observable that emits the items emitted by three Observables, one after the other, without * interleaving them. * <p> * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt=""> * <dl> * <dt><b>Scheduler:</b></dt> * <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd> * </dl> * * @param t1 * an Observable to be concatenated * @param t2 * an Observable to be concatenated * @param t3 * an Observable to be concatenated * @return an Observable that emits items emitted by the three source Observables, one after the other, * without interleaving them * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Mathematical-and-Aggregate-Operators#concat">RxJava wiki: concat</a> */ public final static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3) { return concat(just(t1, t2, t3)); }
0 0
- RxJava 操作符 concat
- RxJava(八)concat符操作处理多数据源
- RxJava concat符操作处理多数据源
- RxJava concat符操作处理多数据源
- Android函数响应式编程——必学的RxJava组合操作符startWith、merge、concat、zip、combineLastest
- [RxJava笔记]RxJava操作符
- RxJava 操作符 combineLatest
- RxJava 操作符 interval
- RxJava 操作符 take
- RxJava操作符 reduce
- RxJava操作符学习
- RxJava defer操作符
- RXJAVA操作符
- RxJava 的操作符
- RxJava 操作符分类
- RxJava操作符
- RxJava操作符-subscribeOn
- RxJava 组合操作符
- WebStorm配置Compass
- button cannot be resolved or is not a field
- Spring Data JPA 全局DAO的扩展
- R1 Lecture 08 Class Notes
- 【QT学习记录】Qt分割窗口QSplitter类
- RxJava 操作符 concat
- android-AsyncTask类
- 软件借用RSA增加注册功能
- 第七周项目2-自选图形用户界面程序开发
- Android读取assets目录下的资源 (webview加载assets下的html)
- PHPCMS添加后台管理界面菜单
- mapreduce输出结果到mysql
- ios 编译并使用Protocol Buffer
- Compare Version Numbers