@Test
public void test8SourcesOverload() {
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<Integer> s6 = Observable.just(6);
Observable<Integer> s7 = Observable.just(7);
Observable<Integer> s8 = Observable.just(8);
Observable<List<Integer>> result = Observable.combineLatest(s1, s2, s3, s4, s5, s6, s7, s8,
new Func8<Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, List<Integer>>() {
@Override
public List<Integer> call(Integer t1, Integer t2, Integer t3, Integer t4, Integer t5, Integer t6, Integer t7, Integer t8) {
return Arrays.asList(t1, t2, t3, t4, t5, t6, t7, t8);
}
});
@SuppressWarnings("unchecked")
Observer<Object> o = mock(Observer.class);
result.subscribe(o);
verify(o).onNext(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8));
verify(o).onComplete();
verify(o, never()).onError(any(Throwable.class));
}
java类rx.functions.Func8的实例源码
OnSubscribeCombineLatestTest.java 文件源码
项目:RxJavaFlow
阅读 21
收藏 0
点赞 0
评论 0
Observable.java 文件源码
项目:letv
阅读 28
收藏 0
点赞 0
评论 0
public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8, Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> combineFunction) {
return combineLatest(Arrays.asList(new Observable[]{o1, o2, o3, o4, o5, o6, o7, o8}), Functions.fromFunc(combineFunction));
}
Observable.java 文件源码
项目:letv
阅读 20
收藏 0
点赞 0
评论 0
public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8, Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> zipFunction) {
return just(new Observable[]{o1, o2, o3, o4, o5, o6, o7, o8}).lift(new OperatorZip(zipFunction));
}
Single.java 文件源码
项目:boohee_v5.6
阅读 27
收藏 0
点赞 0
评论 0
public static final <T1, T2, T3, T4, T5, T6, T7, T8, R> Single<R> zip(Single<? extends T1> o1, Single<? extends T2> o2, Single<? extends T3> o3, Single<? extends T4> o4, Single<? extends T5> o5, Single<? extends T6> o6, Single<? extends T7> o7, Single<? extends T8> o8, Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> zipFunction) {
return just(new Observable[]{asObservable(o1), asObservable(o2), asObservable(o3), asObservable(o4), asObservable(o5), asObservable(o6), asObservable(o7), asObservable(o8)}).lift(new OperatorZip((Func8) zipFunction));
}
OperatorZip.java 文件源码
项目:boohee_v5.6
阅读 23
收藏 0
点赞 0
评论 0
public OperatorZip(Func8 f) {
this.zipFunction = Functions.fromFunc(f);
}
Observable.java 文件源码
项目:boohee_v5.6
阅读 21
收藏 0
点赞 0
评论 0
public static final <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8, Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> combineFunction) {
return combineLatest(Arrays.asList(new Observable[]{o1, o2, o3, o4, o5, o6, o7, o8}), Functions.fromFunc(combineFunction));
}
Observable.java 文件源码
项目:boohee_v5.6
阅读 29
收藏 0
点赞 0
评论 0
public static final <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8, Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> zipFunction) {
return just(new Observable[]{o1, o2, o3, o4, o5, o6, o7, o8}).lift(new OperatorZip(zipFunction));
}
RxHelper.java 文件源码
项目:sfs
阅读 28
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked")
public static final <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> combineSinglesDelayError(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8,
Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> combineFunction) {
return combineSinglesDelayError(asList(o1.single(), o2.single(), o3.single(), o4.single(), o5.single(), o6.single(), o7.single(), o8.single()), fromFunc(combineFunction));
}
OperatorZip.java 文件源码
项目:RxJavaFlow
阅读 19
收藏 0
点赞 0
评论 0
@SuppressWarnings({ "unchecked", "rawtypes" })
public OperatorZip(Func8 f) {
this.zipFunction = Functions.fromFunc(f);
}
OperatorZip.java 文件源码
项目:org.openntf.domino
阅读 21
收藏 0
点赞 0
评论 0
@SuppressWarnings({ "unchecked", "rawtypes" })
public OperatorZip(Func8 f) {
this.zipFunction = Functions.fromFunc(f);
}