当前位置: 首页>>代码示例>>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;未经允许,请勿转载。