cyclops.reactive.ReactiveSeq.printOut()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(101)

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

ReactiveSeq.printOut介绍

暂无

代码示例

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

/**
 *  Print each value in this Folds to the console in turn (left-to-right)
 */
default void printOut() {
  stream().printOut();
}

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

@Test
public void testEnums(){
  ReactiveSeq.enums(Days.class)
        .printOut();
}
BiPredicate TRUE = (t, u) -> true;

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

@Test
public void iterate(){
  Spouts.iterate(1,i->i+1).limit(3).printOut();
  Iterator<Integer> it = Spouts.iterate(1,i->i+1).limit(3).iterator();
  List<Integer> list = new ArrayList<>();
  while(it.hasNext()){
    list.add(it.next());
  }
  assertThat(list,equalTo(Arrays.asList(1,2,3)));
}
@Test

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

@Test
public void splitAtExp(){
  of(1, 2, 3).peek(e->System.out.println("Peeking! " +e)).splitAt(0).transform( (a, b)->{
    a.printOut();
    b.printOut();
    return null;
  });
}

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

@Test
public void splitAtExp(){
  of(1, 2, 3).peek(e->System.out.println("Peeking! " +e)).splitAt(0).transform( (a, b)->{
    a.printOut();
    b.printOut();
    return null;
  });
}

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

@Test
public void splitAtExp(){
  of(1, 2, 3).peek(e->System.out.println("Peeking! " +e)).splitAt(0).transform( (a, b)->{
    a.printOut();
    b.printOut();
    return null;
  });
}

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

@Test
public void mergeLatest(){
  Spouts.mergeLatest(Spouts.of(1,2,3),Spouts.of(5,6,7)).printOut();
  Spouts.mergeLatest(Spouts.of(10,20,30),nextAsyncRS()).printOut();
}
@Test

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

@Test
public void merge(){
  Spouts.mergeLatest(Spouts.of(1,2,3),Spouts.of(5,6,7)).printOut();
  Spouts.mergeLatest(Spouts.of(10,20,30),nextAsyncRS()).printOut();
}
@Test

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

@Test
public void skip(){
  assertThat(of(1,2,3).skip(1).count(),equalTo(2l));
  of(10,1,10,2,10,3).skip(1).printOut();
  of(1,2,3).flatMap(i->Stream.of(10,i)).skip(1).printOut();
}
@Test

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

@Test
public void reversedRange(){
  Spouts.range(10, -10).printOut();
  assertThat(Spouts.range(10, -10).count(),equalTo(20L));
}
@Test

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

@Test
public void limit(){
  assertThat(of(1,2,3).limit(2).count(),equalTo(2l));
  of(10,1,10,2,10,3).skip(1).printOut();
  of(1,2,3).flatMap(i->Stream.of(10,i)).skip(1).printOut();
}
@Test

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

@Test
  public void put(){

    TreeMap<Integer,String> map = TreeMap.fromMap(Comparator.naturalOrder(), HashMap.of(1,"hello",2,"world"));

    map.stream().printOut();

    map.put(10,"boo!")
        .put(20,"world").remove(10).stream().printOut();

    System.out.println(map.put(10,"boo!").elementAt(10).orElse(null));
  }
}

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

@Test
public void rangeLong(){
  ReactiveSeq.rangeLong(0,5).reverse().reverse().reverse().printOut();
  of('a').zipWithStream(ReactiveSeq.rangeLong(0,100)).printOut();
}
@Test

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

@Test
public void duplicateTest(){
  Tuple2<ReactiveSeq<Integer>, ReactiveSeq<Integer>> tp = Spouts.of(1, 2, 3, 4).duplicate();
 //   tp._1.printOut();
 //  tp._2.printOut();
  System.out.println("Merge!");
 //   tp._1.mergeP(tp._2).printOut();
  Spouts.of("a","b","c").mergeP(ReactiveSeq.of("bb","cc")).printOut();
}
@Test

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

@Test
public void intStreamCompareReversed(){
  assertThat(Spouts.range(-5,6).toList(),equalTo(Arrays.asList(-5,-4,-3,-2,-1,0,1,2,3,4,5)));
  Spouts.range(-5,6).reverse().printOut();
  assertThat(0,
      equalTo(Spouts.range(-5,6).reverse().sumInt(i->i)));
}
@Test

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

@Test
public void longStreamCompareReversed(){
  assertThat(Spouts.rangeLong(-5,6).toList(),equalTo(ReactiveSeq.of(-5,-4,-3,-2,-1,0,1,2,3,4,5).map(Integer::longValue).toList()));
  Spouts.rangeLong(-5,6).printOut();
  Spouts.rangeLong(-5,6).reverse().printOut();
  assertThat(0L,
      equalTo(Spouts.rangeLong(-5,6).reverse().sumLong(i->i)));
}

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

@Test
public void take2Reversed(){
  ReactiveSeq.range(0,Integer.MAX_VALUE).reverse().limit(2).printOut();
  assertThat(ReactiveSeq.range(0,Integer.MAX_VALUE).reverse().limit(2).toList(),equalTo(Arrays.asList(2147483646, 2147483645)));
}
@Test

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

@Test
public void iterate(){
  FluentFunctions.of(this::add)
          .iterate(1,2,(i)->Tuple.tuple(i,i))
          .limit(10)
          .printOut();
  assertThat(FluentFunctions.of(this::add)
          .iterate(1,2,(i)->Tuple.tuple(i,i))
          .limit(2)
          .toList().size(),equalTo(2));
}

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

@Test
public void multipleGrouped() throws Exception {
  final Streamable<Integer> fixed = Streamable.fromStream(of(5, 7, 9,10));
  assertThat(fixed.stream().grouped(3).elementAt(0).toOptional().get(),equalTo(Vector.of(5,7,9)));
  fixed.stream().grouped(3).printOut();
  assertThat(fixed.stream().grouped(3).count(),equalTo(2l));
}

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

@Test @Ignore
public void limitLast(){
  AsyncSubscriber<String> pushable = Spouts.asyncSubscriber();
  ReactiveSeq<String> stream = pushable.stream();
  pushable.onNext("hello1");
  pushable.onNext("hello2");
  pushable.onNext("hello3");
  pushable.onComplete();
  // stream.printOut();
  stream.takeRight(2).zipWithStream(Stream.of(1,2)).printOut();
}

相关文章

微信公众号

最新文章

更多

ReactiveSeq类方法