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

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

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

ReactiveSeq.scanLeft介绍

[英]Scan left using supplied Monoid

assertEquals(asList("", "a", "ab", "abc"),ReactiveSeq.of("a", "b", "c")

[中]使用提供的Monoid向左扫描

assertEquals(asList("", "a", "ab", "abc"),ReactiveSeq.of("a", "b", "c")

代码示例

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

@Test
public void testScanLeftStringConcat() {
  System.out.println((of("a", "b", "c").scanLeft("", String::concat).toList()));
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
      is(4));
}
@Test

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

@Test
public void testScanLeftSum() {
  assertThat(of("a", "ab", "abc").map(str->str.length()).scanLeft(0, (u, t) -> u + t).toList().size(),
      is(asList(0, 1, 3, 6).size()));
}
@Test

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

@Override
public Publisher<Long> createPublisher(long elements) {
  return Spouts.iterate(0l, i->i+1l).limit(elements-1).scanLeft(1l,(a,b)->a+b);
}

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

@Test
public void testScanLeftSum() {
  assertThat(of("a", "ab", "abc").map(str->str.length()).scanLeft(0, (u, t) -> u + t).toList().size(),
      is(asList(0, 1, 3, 6).size()));
}
@Test

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

@Test
public void testScanLeftSum() {
  assertThat(of("a", "ab", "abc").map(str->str.length()).scanLeft(0, (u, t) -> u + t).toList().size(),
      is(asList(0, 1, 3, 6).size()));
}
@Test

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

@Test
public void testScanLeftSum() {
  assertThat(of("a", "ab", "abc").map(str->str.length()).scanLeft(0, (u, t) -> u + t).toList().size(),
      is(asList(0, 1, 3, 6).size()));
}
@Test

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

@Test
public void testScanLeftSum() {
  assertThat(of("a", "ab", "abc").map(str->str.length()).scanLeft(0, (u, t) -> u + t).toList().size(),
      is(asList(0, 1, 3, 6).size()));
}
@Test

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

@Test
public void testScanLeftSum() {
  assertThat(of("a", "ab", "abc").map(str->str.length()).scanLeft(0, (u, t) -> u + t).toList().size(),
      is(asList(0, 1, 3, 6).size()));
}
@Test

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
      is(4));
}
@Test

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
      is(4));
}
@Test

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
      is(4));
}
@Test

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
      is(4));
}
@Test

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList(), is(asList("", "a", "ab", "abc")));
}

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(),
      is(4));
}
@Test

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).toList(), is(asList("", "a", "ab", "abc")));
}

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

@Test
public void testScanLeftSumMonoid() {
  assertThat(of("a", "ab", "abc").map(str -> str.length()).scanLeft(Reducers.toTotalInt()).toList(), is(asList(0, 1, 3, 6)));
}

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

@Test
public void testScanLeftSumMonoid() {
  assertThat(of("a", "ab", "abc").map(str -> str.length()).scanLeft(Reducers.toTotalInt()).toList(), is(asList(0, 1, 3, 6)));
}

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

@Test
public void testScanLeftStringConcat() {
  assertThat(of("a", "b", "c").scanLeft("", String::concat).to(Streamable::fromStream).toList(), is(asList("", "a", "ab", "abc")));
}

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

@Test
public void testScanLeftStringConcatMonoid() {
  assertThat(of("a", "b", "c").scanLeft(Reducers.toString("")).toList(), is(asList("", "a", "ab", "abc")));
}

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

@Test
public void testScanLeftSumMonoid() {
  assertThat(of("a", "ab", "abc").map(str -> str.length()).scanLeft(Reducers.toTotalInt()).to(Streamable::fromStream).toList(), is(asList(0, 1, 3, 6)));
}
@Test

相关文章

微信公众号

最新文章

更多

ReactiveSeq类方法