本文整理汇总了Java中rx.exceptions.Exceptions.propagate方法的典型用法代码示例。如果您正苦于以下问题:Java Exceptions.propagate方法的具体用法?Java Exceptions.propagate怎么用?Java Exceptions.propagate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.exceptions.Exceptions
的用法示例。
在下文中一共展示了Exceptions.propagate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasNext
import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public boolean hasNext() {
if (this.iNotif == null || !this.iNotif.isOnError()) {
if ((this.iNotif == null || !this.iNotif.isOnCompleted()) && this.iNotif == null) {
try {
this.notify.acquire();
this.iNotif = (Notification) this.value.getAndSet(null);
if (this.iNotif.isOnError()) {
throw Exceptions.propagate(this.iNotif.getThrowable());
}
} catch (InterruptedException ex) {
unsubscribe();
Thread.currentThread().interrupt();
this.iNotif = Notification.createOnError(ex);
throw Exceptions.propagate(ex);
}
}
return !this.iNotif.isOnCompleted();
} else {
throw Exceptions.propagate(this.iNotif.getThrowable());
}
}
示例2: hasNext
import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public boolean hasNext() {
if (this.buf == null) {
this.buf = take();
this.received++;
if (this.received >= LIMIT) {
request((long) this.received);
this.received = 0;
}
}
if (this.buf.isOnError()) {
throw Exceptions.propagate(this.buf.getThrowable());
} else if (this.buf.isOnCompleted()) {
return false;
} else {
return true;
}
}
示例3: hasNext
import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public boolean hasNext() {
if (this.error != null) {
throw Exceptions.propagate(this.error);
} else if (!this.hasNext) {
return false;
} else {
if (this.isNextConsumed) {
return moveToNext();
}
return true;
}
}
示例4: moveToNext
import rx.exceptions.Exceptions; //导入方法依赖的package包/类
private boolean moveToNext() {
try {
if (!this.started) {
this.started = true;
this.observer.setWaiting(1);
this.items.materialize().subscribe(this.observer);
}
Notification<? extends T> nextNotification = this.observer.takeNext();
if (nextNotification.isOnNext()) {
this.isNextConsumed = false;
this.next = nextNotification.getValue();
return true;
}
this.hasNext = false;
if (nextNotification.isOnCompleted()) {
return false;
}
if (nextNotification.isOnError()) {
this.error = nextNotification.getThrowable();
throw Exceptions.propagate(this.error);
}
throw new IllegalStateException("Should not reach here");
} catch (InterruptedException e) {
this.observer.unsubscribe();
Thread.currentThread().interrupt();
this.error = e;
throw Exceptions.propagate(this.error);
}
}
示例5: next
import rx.exceptions.Exceptions; //导入方法依赖的package包/类
public T next() {
if (this.error != null) {
throw Exceptions.propagate(this.error);
} else if (hasNext()) {
this.isNextConsumed = true;
return this.next;
} else {
throw new NoSuchElementException("No more elements");
}
}
示例6: take
import rx.exceptions.Exceptions; //导入方法依赖的package包/类
private Notification<? extends T> take() {
try {
Notification<? extends T> poll = (Notification) this.notifications.poll();
return poll != null ? poll : (Notification) this.notifications.take();
} catch (InterruptedException e) {
unsubscribe();
throw Exceptions.propagate(e);
}
}