本文整理匯總了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;
}
});
}