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


Java Func2.call方法代碼示例

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


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

示例1: elementsEqual

import rx.functions.Func2; //導入方法依賴的package包/類
public static <T> boolean elementsEqual(List<T> list1, List<T> list2, Func2<T, T, Boolean> comparator) {
    if (list1 == null || list2 == null) {
        return false;
    }

    if (list1.size() != list2.size()) {
        return false;
    }

    for (int i = 0; i < list1.size(); i++) {
        if (!comparator.call(list1.get(i), list2.get(i))) {
            return false;
        }
    }

    return true;
}
 
開發者ID:lyft,項目名稱:scoop,代碼行數:18,代碼來源:Lists.java

示例2: indexOf

import rx.functions.Func2; //導入方法依賴的package包/類
/**
 * Returns the index of the first element in `xs` that equals `x`, or `-1` if `x` is not found in `xs`. Equality is determined
 * by the given function.
 */
public static <T> int indexOf(final @NonNull List<T> xs, final @NonNull T y, final @NonNull Func2<T, T, Boolean> equality) {
  for (int idx = 0; idx < xs.size(); idx++) {
    if (equality.call(xs.get(idx), y)) {
      return idx;
    }
  }
  return -1;
}
 
開發者ID:kickstarter,項目名稱:android-oss,代碼行數:13,代碼來源:ListUtils.java

示例3: createChannel

import rx.functions.Func2; //導入方法依賴的package包/類
private synchronized ChannelWrapper createChannel(ChannelType type, Func2<Integer, Channel, ChannelImpl> channelFunction) throws IOException {
    Channel innerChannel = getOrCreateConnection(type).createChannel();
    ConnectionInfo info = conToChannel.get(type);
    ChannelImpl channel = channelFunction.call(innerChannel.hashCode(), innerChannel);
    info.channels.add(channel);
    log.infoWithParams("Successfully created "+type+" channel.",
            "channel", channel,
            "properties", info.clientProperties);
    return channel;
}
 
開發者ID:meltwater,項目名稱:rxrabbit,代碼行數:11,代碼來源:DefaultChannelFactory.java

示例4: flip

import rx.functions.Func2; //導入方法依賴的package包/類
/**
 * @param func
 * @return
 */
public static <T0, T1, R> Func2<T1, T0, R> flip(final Func2<? super T0, ? super T1, ? extends R> func) {
    return new Func2<T1, T0, R>() {
        @Override
        public R call(T1 t1, T0 t0) {
            return func.call(t0, t1);
        }
    };
}
 
開發者ID:stealthcode,項目名稱:RxJavaMulti,代碼行數:13,代碼來源:BiObservable.java

示例5: writeToResource

import rx.functions.Func2; //導入方法依賴的package包/類
private static <T, Resource> Func1<List<T>, Observable<Resource>> writeToResource(
        final Func2<Observable<T>, Resource, Observable<Resource>> writer,
        final Func0<Resource> resourceFactory) {
    return a -> {
        Resource resource = resourceFactory.call();
        return writer.call(Observable.from(a), resource);
    };
}
 
開發者ID:davidmoten,項目名稱:bigsort,代碼行數:9,代碼來源:BigSort.java


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