本文整理汇总了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);
}
}
示例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);
}
}
示例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");
}
示例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");
}
示例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);
}
}
示例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;
}
});
}