本文整理汇总了Java中rx.functions.Func1.call方法的典型用法代码示例。如果您正苦于以下问题:Java Func1.call方法的具体用法?Java Func1.call怎么用?Java Func1.call使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rx.functions.Func1
的用法示例。
在下文中一共展示了Func1.call方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import rx.functions.Func1; //导入方法依赖的package包/类
/**
* Applies a function to the current value, emitting the new returned value.
* <p>
* The function should fast to take less synchronized time.
*/
public void apply(Func1<T, T> func) {
synchronized (this) {
value = func.call(value);
for (Subscriber<? super T> subscriber : subscribers) {
queue.add(new Entry<>(subscriber, value));
}
}
emit();
}
示例2: toPredicate2
import rx.functions.Func1; //导入方法依赖的package包/类
public static <T> Func2<T, Integer, Boolean> toPredicate2(final Func1<? super T, Boolean> predicate) {
return new Func2<T, Integer, Boolean>() {
public Boolean call(T t1, Integer t2) {
return (Boolean) predicate.call(t1);
}
};
}
示例3: to
import rx.functions.Func1; //导入方法依赖的package包/类
public final <U> U to(Func1<? super Completable, U> converter) {
return converter.call(this);
}
示例4: extend
import rx.functions.Func1; //导入方法依赖的package包/类
@Experimental
public <R> R extend(Func1<? super OnSubscribe<T>, ? extends R> conversion) {
return conversion.call(new OnSubscribeExtend(this));
}
示例5: bind
import rx.functions.Func1; //导入方法依赖的package包/类
/**
* Binds some UI function to {@link Observable}. Usually used in Presenter/ViewModel/etc classes.
*
* @param observable not-null source {@link Observable}.
* @param uiFunc not-null function that actually performs binding of the {@link Observable} to something, for example UI.
* @param <T> type of {@link Observable} emission.
* @return {@link Subscription} that can be used to unsubscribe and stop bound action.
*/
public static <T> Subscription bind(Observable<T> observable, Func1<Observable<T>, Subscription> uiFunc) {
return uiFunc.call(observable);
}