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