本文整理了Java中cyclops.reactive.ReactiveSeq.scanLeft
方法的一些代码示例,展示了ReactiveSeq.scanLeft
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReactiveSeq.scanLeft
方法的具体详情如下:
包路径:cyclops.reactive.ReactiveSeq
类名称: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
内容来源于网络,如有侵权,请联系作者删除!