本文整理了Java中rx.Observable.sequenceEqual()
方法的一些代码示例,展示了Observable.sequenceEqual()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Observable.sequenceEqual()
方法的具体详情如下:
包路径:rx.Observable
类名称:Observable
方法名:sequenceEqual
[英]Returns an Observable that emits a Boolean value that indicates whether two Observable sequences are the same by comparing the items emitted by each Observable pairwise.
Scheduler: sequenceEqual does not operate by default on a particular Scheduler.
[中]返回一个Observable,它发出一个布尔值,通过比较每个Observable成对发出的项来指示两个Observable序列是否相同。
Scheduler:sequenceEqual默认情况下不会在特定的计划程序上运行。
代码示例来源:origin: com.netflix.rxjava/rxjava-core
return sequenceEqual(first, second, new Func2<T, T, Boolean>() {
@Override
public final Boolean call(T first, T second) {
代码示例来源:origin: leeowenowen/rxjava-examples
@Override
public void run() {
Observable.sequenceEqual(Observable.just(1, 2, 3),
Observable.range(1, 3),
new Func2<Integer, Integer, Boolean>() {
@Override
public Boolean call(Integer integer1, Integer integer2) {
return integer1 == integer2;
}
}).subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean aBoolean) {
log(aBoolean);
}
});
}
});
代码示例来源:origin: hawkular/hawkular-metrics
.collect(HashSet<UUID>::new, HashSet::add);
Observable<? extends Set<UUID>> finished = findFinishedJobs(time);
return Observable.sequenceEqual(scheduled, finished).flatMap(allFinished -> {
if (allFinished) {
logger.debugf("All jobs for time slice [%s] have finished", time);
内容来源于网络,如有侵权,请联系作者删除!