gpt4 book ai didi

com.oath.cyclops.internal.stream.spliterators.push.ZippingOperator.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 08:52:31 26 4
gpt4 key购买 nike

本文整理了Java中com.oath.cyclops.internal.stream.spliterators.push.ZippingOperator.<init>()方法的一些代码示例,展示了ZippingOperator.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZippingOperator.<init>()方法的具体详情如下:
包路径:com.oath.cyclops.internal.stream.spliterators.push.ZippingOperator
类名称:ZippingOperator
方法名:<init>

ZippingOperator.<init>介绍

暂无

代码示例

代码示例来源:origin: aol/cyclops

@Override
public <U, R> ReactiveSeq<R> zipWithStream(Stream<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper) {
  Operator<U> right;
  if (other instanceof ReactiveStreamX) {
    right = ((ReactiveStreamX<U>) other).source;
  } else {
    right = new SpliteratorToOperator<U>(((Stream<U>) other).spliterator());
  }
  return createSeq(new ZippingOperator<>(source, right, zipper), async);
}

代码示例来源:origin: aol/cyclops

public Operator<Integer> createTwoAndError(){
  return new ZippingOperator<Integer,Integer,Integer>(Fixtures.twoAndErrorSource,new ArrayOfValuesOperator<>(10,11,12),(a, b)->a+b);
}
public Operator<Integer> createThreeErrors(){

代码示例来源:origin: aol/cyclops

public Operator<Integer> createThreeErrors(){
  return new ZippingOperator<Integer,Integer,Integer>(new ArrayOfValuesOperator<>(10,11,12),Fixtures.threeErrorsSource,(a,b)->a+b);
}

代码示例来源:origin: aol/cyclops

@Override
public <U> ReactiveSeq<Tuple2<T, U>> zipWithStream(Stream<? extends U> other) {
  Operator<U> right;
  if (other instanceof ReactiveStreamX) {
    right = ((ReactiveStreamX<U>) other).source;
  } else if (other instanceof Iterable) {
    right = new IterableSourceOperator<U>(((Iterable<U>) other));
  } else {
    //not replayable
    right = new SpliteratorToOperator<U>(((Stream<U>) other).spliterator());
  }
  ReactiveStreamX<Tuple2<T, U>> res = createSeq(new ZippingOperator<>(source, right, Tuple::tuple));
  if (this.async == SYNC) {
    //zip could recieve an asyncrhonous Stream so we force onto the async path
    return res.withAsync(BACKPRESSURE);
  }
  return res;
}

代码示例来源:origin: aol/cyclops

public Operator<Integer> createThree(){
  return new ZippingOperator<Integer,Integer,Integer>(new ArrayOfValuesOperator<>(1,2,3),new ArrayOfValuesOperator<>(10,11,12),(a,b)->a+b);
}
public Operator<Integer> createTwoAndError(){

代码示例来源:origin: aol/cyclops

public Operator<Integer> createEmpty(){
  return new ZippingOperator<Integer,Integer,Integer>(new ArrayOfValuesOperator<>(),new ArrayOfValuesOperator<>(),(a, b)->a+b);
}
public Operator<Integer> createOne(){

代码示例来源:origin: aol/cyclops

public Operator<Integer> createOne(){
  return new ZippingOperator<Integer,Integer,Integer>(new ArrayOfValuesOperator<>(1),new ArrayOfValuesOperator<>(2),(a,b)->a+b);
}

代码示例来源:origin: com.oath.cyclops/cyclops

@Override
public <U, R> ReactiveSeq<R> zipWithStream(Stream<? extends U> other, BiFunction<? super T, ? super U, ? extends R> zipper) {
  Operator<U> right;
  if (other instanceof ReactiveStreamX) {
    right = ((ReactiveStreamX<U>) other).source;
  } else {
    right = new SpliteratorToOperator<U>(((Stream<U>) other).spliterator());
  }
  return createSeq(new ZippingOperator<>(source, right, zipper), async);
}

代码示例来源:origin: com.oath.cyclops/cyclops

@Override
public <U> ReactiveSeq<Tuple2<T, U>> zipWithStream(Stream<? extends U> other) {
  Operator<U> right;
  if (other instanceof ReactiveStreamX) {
    right = ((ReactiveStreamX<U>) other).source;
  } else if (other instanceof Iterable) {
    right = new IterableSourceOperator<U>(((Iterable<U>) other));
  } else {
    //not replayable
    right = new SpliteratorToOperator<U>(((Stream<U>) other).spliterator());
  }
  ReactiveStreamX<Tuple2<T, U>> res = createSeq(new ZippingOperator<>(source, right, Tuple::tuple));
  if (this.async == SYNC) {
    //zip could recieve an asyncrhonous Stream so we force onto the async path
    return res.withAsync(BACKPRESSURE);
  }
  return res;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com