Java 类io.reactivex.schedulers.Timed 实例源码

项目:RxJava2-Android-Sample    文件:TimeIntervalExampleActivity.java   
private Observer<Timed<Long>> getObserver() {
    return new Observer<Timed<Long>>() {

        @Override
        public void onSubscribe(Disposable d) {
            Log.d(TAG, " onSubscribe : " + d.isDisposed());
        }

        @Override
        public void onNext(Timed<Long> value) {
            textView.append(" onNext : value : " + value);
            textView.append(AppConstant.LINE_SEPARATOR);
            Log.d(TAG, " onNext : value : " + value);
        }

        @Override
        public void onError(Throwable e) {
            textView.append(" onError : " + e.getMessage());
            textView.append(AppConstant.LINE_SEPARATOR);
            Log.d(TAG, " onError : " + e.getMessage());
        }

        @Override
        public void onComplete() {
            textView.append(" onComplete");
            textView.append(AppConstant.LINE_SEPARATOR);
            Log.d(TAG, " onComplete");
        }
    };
}
项目:RxJava2-Android-Sample    文件:TimestampExampleActivity.java   
private Observer<Timed<String>> getObserver() {
    return new Observer<Timed<String>>() {

        @Override
        public void onSubscribe(Disposable d) {
            Log.d(TAG, " onSubscribe : " + d.isDisposed());
        }

        @Override
        public void onNext(Timed<String> value) {
            textView.append(" onNext : value : " + value.value() + ", time:" + value.time());
            textView.append(AppConstant.LINE_SEPARATOR);
            Log.d(TAG, " onNext : value : " + value);
        }

        @Override
        public void onError(Throwable e) {
            textView.append(" onError : " + e.getMessage());
            textView.append(AppConstant.LINE_SEPARATOR);
            Log.d(TAG, " onError : " + e.getMessage());
        }

        @Override
        public void onComplete() {
            textView.append(" onComplete");
            textView.append(AppConstant.LINE_SEPARATOR);
            Log.d(TAG, " onComplete");
        }
    };
}
项目:RxComboDetector    文件:RxComboDetector.java   
@VisibleForTesting
static Flowable<Integer> detect(Flowable<Integer> clicks, final long maxIntervalMillis,
        final int minComboTimesCared) {
    return clicks.timestamp()
            .scan((lastOne, thisOne) -> {
                if (thisOne.time() - lastOne.time() <= maxIntervalMillis) {
                    return new Timed<>(lastOne.value() + 1, thisOne.time(), thisOne.unit());
                } else {
                    return new Timed<>(1, thisOne.time(), thisOne.unit());
                }
            })
            .map(Timed::value)
            .filter(combo -> combo >= minComboTimesCared);
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timeInterval() {
    return boxed.timeInterval();
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timeInterval(Scheduler scheduler) {
    return boxed.timeInterval(scheduler);
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timeInterval(TimeUnit unit) {
    return boxed.timeInterval(unit);
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timeInterval(TimeUnit unit, Scheduler scheduler) {
    return boxed.timeInterval(unit, scheduler);
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timestamp() {
    return boxed.timestamp();
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timestamp(Scheduler scheduler) {
    return boxed.timestamp(scheduler);
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timestamp(TimeUnit unit) {
    return boxed.timestamp(unit);
}
项目:cyclops    文件:ObservableKind.java   
@CheckReturnValue
@SchedulerSupport("none")
public Observable<Timed<T>> timestamp(TimeUnit unit, Scheduler scheduler) {
    return boxed.timestamp(unit, scheduler);
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timeInterval() {
    return boxed.timeInterval();
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timeInterval(io.reactivex.Scheduler scheduler) {
    return boxed.timeInterval(scheduler);
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timeInterval(TimeUnit unit) {
    return boxed.timeInterval(unit);
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timeInterval(TimeUnit unit, io.reactivex.Scheduler scheduler) {
    return boxed.timeInterval(unit, scheduler);
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timestamp() {
    return boxed.timestamp();
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timestamp(io.reactivex.Scheduler scheduler) {
    return boxed.timestamp(scheduler);
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timestamp(TimeUnit unit) {
    return boxed.timestamp(unit);
}
项目:cyclops    文件:FlowableKind.java   
@CheckReturnValue
@BackpressureSupport(BackpressureKind.PASS_THROUGH)
@SchedulerSupport("none")
public Flowable<Timed<T>> timestamp(TimeUnit unit, io.reactivex.Scheduler scheduler) {
    return boxed.timestamp(unit, scheduler);
}