本文整理匯總了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);
}
}