@Test
public void test5SourcesOverload() {
Observable<Integer> s1 = Observable.just(1);
Observable<Integer> s2 = Observable.just(2);
Observable<Integer> s3 = Observable.just(3);
Observable<Integer> s4 = Observable.just(4);
Observable<Integer> s5 = Observable.just(5);
Observable<List<Integer>> result = Observable.combineLatest(s1, s2, s3, s4, s5,
new Func5<Integer, Integer, Integer, Integer, Integer, List<Integer>>() {
@Override
public List<Integer> call(Integer t1, Integer t2, Integer t3, Integer t4, Integer t5) {
return Arrays.asList(t1, t2, t3, t4, t5);
}
});
@SuppressWarnings("unchecked")
Observer<Object> o = mock(Observer.class);
result.subscribe(o);
verify(o).onNext(Arrays.asList(1, 2, 3, 4, 5));
verify(o).onComplete();
verify(o, never()).onError(any(Throwable.class));
}
java类rx.functions.Func5的实例源码
OnSubscribeCombineLatestTest.java 文件源码
项目:RxJavaFlow
阅读 24
收藏 0
点赞 0
评论 0
Observable.java 文件源码
项目:letv
阅读 24
收藏 0
点赞 0
评论 0
public static <T1, T2, T3, T4, T5, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> combineFunction) {
return combineLatest(Arrays.asList(new Observable[]{o1, o2, o3, o4, o5}), Functions.fromFunc(combineFunction));
}
Observable.java 文件源码
项目:letv
阅读 19
收藏 0
点赞 0
评论 0
public static <T1, T2, T3, T4, T5, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> zipFunction) {
return just(new Observable[]{o1, o2, o3, o4, o5}).lift(new OperatorZip(zipFunction));
}
Single.java 文件源码
项目:boohee_v5.6
阅读 24
收藏 0
点赞 0
评论 0
public static final <T1, T2, T3, T4, T5, R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Single<? extends T5> o5, Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> zipFunction) {
return just(new Observable[]{asObservable(o1), asObservable(o2), asObservable(o3), asObservable(o4), asObservable(o5)}).lift(new OperatorZip((Func5) zipFunction));
}
OperatorZip.java 文件源码
项目:boohee_v5.6
阅读 22
收藏 0
点赞 0
评论 0
public OperatorZip(Func5 f) {
this.zipFunction = Functions.fromFunc(f);
}
Observable.java 文件源码
项目:boohee_v5.6
阅读 21
收藏 0
点赞 0
评论 0
public static final <T1, T2, T3, T4, T5, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> combineFunction) {
return combineLatest(Arrays.asList(new Observable[]{o1, o2, o3, o4, o5}), Functions.fromFunc(combineFunction));
}
Observable.java 文件源码
项目:boohee_v5.6
阅读 30
收藏 0
点赞 0
评论 0
public static final <T1, T2, T3, T4, T5, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> zipFunction) {
return just(new Observable[]{o1, o2, o3, o4, o5}).lift(new OperatorZip(zipFunction));
}
RxHelper.java 文件源码
项目:sfs
阅读 21
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked")
public static final <T1, T2, T3, T4, T5, R> Observable<R> combineSinglesDelayError(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5,
Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> combineFunction) {
return combineSinglesDelayError(asList(o1.single(), o2.single(), o3.single(), o4.single(), o5.single()), fromFunc(combineFunction));
}
OperatorZip.java 文件源码
项目:RxJavaFlow
阅读 21
收藏 0
点赞 0
评论 0
@SuppressWarnings({ "unchecked", "rawtypes" })
public OperatorZip(Func5 f) {
this.zipFunction = Functions.fromFunc(f);
}
OperatorZip.java 文件源码
项目:org.openntf.domino
阅读 25
收藏 0
点赞 0
评论 0
@SuppressWarnings({ "unchecked", "rawtypes" })
public OperatorZip(Func5 f) {
this.zipFunction = Functions.fromFunc(f);
}