本文整理汇总了Java中rx.annotations.Experimental类的典型用法代码示例。如果您正苦于以下问题:Java Experimental类的具体用法?Java Experimental怎么用?Java Experimental使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Experimental类属于rx.annotations包,在下文中一共展示了Experimental类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CompositeException
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public CompositeException(Throwable... errors) {
this.cause = null;
Set<Throwable> deDupedExceptions = new LinkedHashSet();
List<Throwable> _exceptions = new ArrayList();
if (errors != null) {
for (Throwable ex : errors) {
if (ex instanceof CompositeException) {
deDupedExceptions.addAll(((CompositeException) ex).getExceptions());
} else if (ex != null) {
deDupedExceptions.add(ex);
} else {
deDupedExceptions.add(new NullPointerException());
}
}
} else {
deDupedExceptions.add(new NullPointerException());
}
_exceptions.addAll(deDupedExceptions);
this.exceptions = Collections.unmodifiableList(_exceptions);
this.message = this.exceptions.size() + " exceptions occurred. ";
}
开发者ID:JackChan1999,项目名称:letv,代码行数:23,代码来源:CompositeException.java
示例2: subscribe
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public void subscribe(final Action1<? super T> onNext, final Action1<? super Throwable> onError, final Action0 onCompleted) {
subscribe(new Observer<T>() {
public void onNext(T t) {
onNext.call(t);
}
public void onError(Throwable e) {
onError.call(e);
}
public void onCompleted() {
onCompleted.call();
}
});
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:17,代码来源:BlockingObservable.java
示例3: readJsonObservable
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public JsonObservable readJsonObservable(final String filePath) {
final Observable<JsonReader> jsonReaderObservable = Observable.fromCallable(new Callable<JsonReader>() {
@Override
public JsonReader call() throws Exception {
return GsonFunctions.readJson(filePath);
}
});
return new JsonObservable(new Observable.OnSubscribe<JsonReader>() {
@Override
public void call(Subscriber<? super JsonReader> subscriber) {
jsonReaderObservable.unsafeSubscribe(subscriber);
}
});
}
开发者ID:masterlittle,项目名称:RGson,代码行数:17,代码来源:RGson.java
示例4: concatMapDelayError
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public final <R> Observable<R> concatMapDelayError(Func1<? super T, ? extends Observable<? extends R>> func) {
if (this instanceof ScalarSynchronousObservable) {
return ((ScalarSynchronousObservable) this).scalarFlatMap(func);
}
return create(new OnSubscribeConcatMap(this, func, 2, 2));
}
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:Observable.java
示例5: delaySubscription
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public final <U> Observable<T> delaySubscription(Observable<U> other) {
if (other != null) {
return create(new OnSubscribeDelaySubscriptionOther(this, other));
}
throw new NullPointerException();
}
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:Observable.java
示例6: concatMapEager
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public final <R> Observable<R> concatMapEager(Func1<? super T, ? extends Observable<? extends R>> mapper, int capacityHint) {
if (capacityHint >= 1) {
return lift(new OperatorEagerConcatMap(mapper, capacityHint, Integer.MAX_VALUE));
}
throw new IllegalArgumentException("capacityHint > 0 required but it was " + capacityHint);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:Observable.java
示例7: call
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static <T> Single<T> fromCallable(final Callable<? extends T> func) {
return create(new OnSubscribe<T>() {
public void call(SingleSubscriber<? super T> singleSubscriber) {
try {
singleSubscriber.onSuccess(func.call());
} catch (Throwable t) {
Exceptions.throwIfFatal(t);
singleSubscriber.onError(t);
}
}
});
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:Single.java
示例8: onCompleted
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public final Single<T> doOnError(final Action1<Throwable> onError) {
return lift(new OperatorDoOnEach(new Observer<T>() {
public void onCompleted() {
}
public void onError(Throwable e) {
onError.call(e);
}
public void onNext(T t) {
}
}));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:15,代码来源:Single.java
示例9: awaitForComplete
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static void awaitForComplete(CountDownLatch latch, Subscription subscription) {
if (latch.getCount() != 0) {
try {
latch.await();
} catch (InterruptedException e) {
subscription.unsubscribe();
Thread.currentThread().interrupt();
throw new RuntimeException("Interrupted while waiting for subscription to complete.", e);
}
}
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:BlockingUtils.java
示例10: concatMapEager
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public final <R> Observable<R> concatMapEager(Func1<? super T, ? extends Observable<? extends R>> mapper, int capacityHint) {
if (capacityHint >= 1) {
return lift(new OperatorEagerConcatMap(mapper, capacityHint));
}
throw new IllegalArgumentException("capacityHint > 0 required but it was " + capacityHint);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:Observable.java
示例11: call
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static <S, T> Observable$OnSubscribe<T> createSingleState(Func0<? extends S> generator, final Action3<? super S, Long, ? super Observer<Observable<? extends T>>> next) {
return new AsyncOnSubscribeImpl((Func0) generator, new Func3<S, Long, Observer<Observable<? extends T>>, S>() {
public S call(S state, Long requested, Observer<Observable<? extends T>> subscriber) {
next.call(state, requested, subscriber);
return state;
}
});
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:AsyncOnSubscribe.java
示例12: call
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static <S, T> Observable$OnSubscribe<T> createSingleState(Func0<? extends S> generator, final Action2<? super S, ? super Observer<? super T>> next) {
return new SyncOnSubscribeImpl((Func0) generator, new Func2<S, Observer<? super T>, S>() {
public S call(S state, Observer<? super T> subscriber) {
next.call(state, subscriber);
return state;
}
});
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:SyncOnSubscribe.java
示例13: getThrowable
import rx.annotations.Experimental; //导入依赖的package包/类
/**
* Returns the Throwable that terminated the Subject.
* @return the Throwable that terminated the Subject or {@code null} if the
* subject hasn't terminated yet or it terminated normally.
*/
@Experimental
public Throwable getThrowable() {
Object o = state.get();
if (nl.isError(o)) {
return nl.getError(o);
}
return null;
}
开发者ID:novoda,项目名称:rxpresso,代码行数:14,代码来源:ClearableBehaviorSubject.java
示例14: reset
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public void reset() {
this.schedulersHook.set(null);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:RxAndroidPlugins.java
示例15: create
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static <S, T> Observable<T> create(AsyncOnSubscribe<S, T> asyncOnSubscribe) {
return new Observable(hook.onCreate(asyncOnSubscribe));
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:Observable.java
示例16: extend
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public <R> R extend(Func1<? super OnSubscribe<T>, ? extends R> conversion) {
return conversion.call(new OnSubscribeExtend(this));
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:Observable.java
示例17: toCompletable
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public Completable toCompletable() {
return Completable.fromObservable(this);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:Observable.java
示例18: concatDelayError
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static <T> Observable<T> concatDelayError(Observable<? extends Observable<? extends T>> sources) {
return sources.concatMapDelayError(UtilityFunctions.identity());
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:Observable.java
示例19: mergeDelayError
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static <T> Observable<T> mergeDelayError(Observable<? extends Observable<? extends T>> source, int maxConcurrent) {
return source.lift(OperatorMerge.instance(true, maxConcurrent));
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:Observable.java
示例20: switchOnNextDelayError
import rx.annotations.Experimental; //导入依赖的package包/类
@Experimental
public static <T> Observable<T> switchOnNextDelayError(Observable<? extends Observable<? extends T>> sequenceOfSequences) {
return sequenceOfSequences.lift(OperatorSwitch.instance(true));
}
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:Observable.java
注:本文中的rx.annotations.Experimental类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论