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


Java Action1.call方法代碼示例

本文整理匯總了Java中rx.functions.Action1.call方法的典型用法代碼示例。如果您正苦於以下問題:Java Action1.call方法的具體用法?Java Action1.call怎麽用?Java Action1.call使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rx.functions.Action1的用法示例。


在下文中一共展示了Action1.call方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: connect

import rx.functions.Action1; //導入方法依賴的package包/類
public void connect(Action1<? super Subscription> connection) {
    PublishSubscriber<T> ps;
    PublishSubscriber<T> u;
    boolean doConnect;
    do {
        ps = (PublishSubscriber) this.current.get();
        if (ps != null && !ps.isUnsubscribed()) {
            break;
        }
        u = new PublishSubscriber(this.current);
        u.init();
    } while (!this.current.compareAndSet(ps, u));
    ps = u;
    if (ps.shouldConnect.get() || !ps.shouldConnect.compareAndSet(false, true)) {
        doConnect = false;
    } else {
        doConnect = true;
    }
    connection.call(ps);
    if (doConnect) {
        this.source.unsafeSubscribe(ps);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:24,代碼來源:OperatorPublish.java

示例2: connect

import rx.functions.Action1; //導入方法依賴的package包/類
public void connect(Action1<? super Subscription> connection) {
    ReplaySubscriber<T> ps;
    ReplaySubscriber<T> u;
    boolean doConnect;
    do {
        ps = (ReplaySubscriber) this.current.get();
        if (ps != null && !ps.isUnsubscribed()) {
            break;
        }
        u = new ReplaySubscriber(this.current, (ReplayBuffer) this.bufferFactory.call());
        u.init();
    } while (!this.current.compareAndSet(ps, u));
    ps = u;
    if (ps.shouldConnect.get() || !ps.shouldConnect.compareAndSet(false, true)) {
        doConnect = false;
    } else {
        doConnect = true;
    }
    connection.call(ps);
    if (doConnect) {
        this.source.unsafeSubscribe(ps);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:24,代碼來源:OperatorReplay.java

示例3: create

import rx.functions.Action1; //導入方法依賴的package包/類
public static final <T> Observer<T> create(final Action1<? super T> onNext) {
    if (onNext != null) {
        return new Observer<T>() {
            public final void onCompleted() {
            }

            public final void onError(Throwable e) {
                throw new OnErrorNotImplementedException(e);
            }

            public final void onNext(T args) {
                onNext.call(args);
            }
        };
    }
    throw new IllegalArgumentException("onNext can not be null");
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:18,代碼來源:Observers.java

示例4: create

import rx.functions.Action1; //導入方法依賴的package包/類
public static final <T> Subscriber<T> create(final Action1<? super T> onNext) {
    if (onNext != null) {
        return new Subscriber<T>() {
            public final void onCompleted() {
            }

            public final void onError(Throwable e) {
                throw new OnErrorNotImplementedException(e);
            }

            public final void onNext(T args) {
                onNext.call(args);
            }
        };
    }
    throw new IllegalArgumentException("onNext can not be null");
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:18,代碼來源:Subscribers.java

示例5: visit

import rx.functions.Action1; //導入方法依賴的package包/類
public <T> void visit(final T[] parts, final Action1<T> every, final Runnable middle) {
  boolean first = true;

  for (final T it : parts) {
    if (first) {
      first = false;
    } else {
      middle.run();
    }

    every.call(it);
  }
}
 
開發者ID:csync,項目名稱:csync-android,代碼行數:14,代碼來源:Query.java

示例6: createStateless

import rx.functions.Action1; //導入方法依賴的package包/類
@Experimental
public static <T> Observable$OnSubscribe<T> createStateless(final Action1<? super Observer<? super T>> next) {
    return new SyncOnSubscribeImpl(new Func2<Void, Observer<? super T>, Void>() {
        public Void call(Void state, Observer<? super T> subscriber) {
            next.call(subscriber);
            return state;
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:10,代碼來源:SyncOnSubscribe.java


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