當前位置: 首頁>>代碼示例>>Java>>正文


Java Exceptions.propagate方法代碼示例

本文整理匯總了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());
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:22,代碼來源:BlockingOperatorLatest.java

示例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;
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:18,代碼來源:BlockingOperatorToIterator.java

示例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;
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:13,代碼來源:BlockingOperatorNext.java

示例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);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:30,代碼來源:BlockingOperatorNext.java

示例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");
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:11,代碼來源:BlockingOperatorNext.java

示例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);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:10,代碼來源:BlockingOperatorToIterator.java


注:本文中的rx.exceptions.Exceptions.propagate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。