本文整理了Java中cyclops.reactive.ReactiveSeq.combinations
方法的一些代码示例,展示了ReactiveSeq.combinations
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReactiveSeq.combinations
方法的具体详情如下:
包路径:cyclops.reactive.ReactiveSeq
类名称:ReactiveSeq
方法名:combinations
[英]```
ReactiveSeq.of(1,2,3).combinations()
[中]```
ReactiveSeq.of(1,2,3).combinations()
代码示例来源:origin: aol/cyclops
@Override
default ImmutableSortedSet<ReactiveSeq<T>> combinations() {
return unitStream(stream().combinations());
}
}
代码示例来源:origin: aol/cyclops
@Override
default ImmutableQueue<ReactiveSeq<T>> combinations(int size) {
return unitStream(stream().combinations(size));
}
代码示例来源:origin: aol/cyclops
@Override
default ImmutableQueue<ReactiveSeq<T>> combinations() {
return unitStream(stream().combinations());
}
代码示例来源:origin: aol/cyclops
@Test
public void allCombinations3() {
assertThat(Spouts.of(1, 2, 3).combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList(), Arrays.asList(1), Arrays.asList(2),
Arrays.asList(3), Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3), Arrays.asList(1, 2, 3))));
}
代码示例来源:origin: aol/cyclops
@Test
public void allCombinations3() {
assertThat(of(1, 2, 3).combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList(), Arrays.asList(1), Arrays.asList(2),
Arrays.asList(3), Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3), Arrays.asList(1, 2, 3))));
}
代码示例来源:origin: aol/cyclops
@Test
public void allCombinations3() {
assertThat(ReactiveSeq.of(1, 2, 3).combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList(), Arrays.asList(1), Arrays.asList(2),
Arrays.asList(3), Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3), Arrays.asList(1, 2, 3))));
}
代码示例来源:origin: aol/cyclops
@Test
public void allCombinations3() {
assertThat(of(1, 2, 3).combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList(), Arrays.asList(1), Arrays.asList(2),
Arrays.asList(3), Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3), Arrays.asList(1, 2, 3))));
}
代码示例来源:origin: aol/cyclops
@Test
public void allCombinations3() {
assertThat(Spouts.of(1, 2, 3).combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList(), Arrays.asList(1), Arrays.asList(2),
Arrays.asList(3), Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3), Arrays.asList(1, 2, 3))));
}
代码示例来源:origin: aol/cyclops
@Test
public void allCombinations3() {
assertThat(of(1, 2, 3).combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList(), Arrays.asList(1), Arrays.asList(2),
Arrays.asList(3), Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3), Arrays.asList(1, 2, 3))));
}
代码示例来源:origin: aol/cyclops
@Test
public void combinations2() {
assertThat(ReactiveSeq.of(1, 2, 3).combinations(2).map(s->s.toList()).toList(),
equalTo(Arrays.asList(Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3))));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void combinations2() {
assertThat(Spouts.of(1, 2, 3).combinations(2).map(s->s.toList()).toList(),
equalTo(Arrays.asList(Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3))));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void combinations2() {
assertThat(of(1, 2, 3).combinations(2).map(s->s.toList()).toList(),
equalTo(Arrays.asList(Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3))));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void combinations2() {
assertThat(Spouts.of(1, 2, 3).combinations(2).map(s->s.toList()).toList(),
equalTo(Arrays.asList(Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3))));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void combinations2() {
assertThat(of(1, 2, 3).combinations(2).map(s->s.toList()).toList(),
equalTo(Arrays.asList(Arrays.asList(1, 2), Arrays.asList(1, 3), Arrays.asList(2, 3))));
}
@Test
代码示例来源:origin: aol/cyclops
@Test
public void emptyAllCombinations() {
assertThat(of().combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList())));
}
代码示例来源:origin: aol/cyclops
@Test
public void emptyAllCombinations() {
assertThat(ReactiveSeq.of().combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList())));
}
代码示例来源:origin: aol/cyclops
@Test
public void emptyAllCombinations() {
assertThat(of().combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList())));
}
代码示例来源:origin: aol/cyclops
@Test
public void emptyAllCombinations() {
assertThat(Spouts.of().combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList())));
}
代码示例来源:origin: aol/cyclops
@Test
public void emptyAllCombinations() {
assertThat(Spouts.of().combinations().map(s->s.toList()).toList(),equalTo(Arrays.asList(Arrays.asList())));
}
代码示例来源:origin: aol/cyclops
@Test
public void combinations(){
SimpleTimer timer = new SimpleTimer();
Streamable.of(1, 2, 3, 4,5,6)
.combinations(3).forEach(s -> System.out.println(s.join(",")));
long streamTime = timer.getElapsedNanoseconds();
System.out.println("Streamable took " + streamTime);
timer = new SimpleTimer();
of(1, 2, 3, 4, 5, 6)
.combinations(3)
.forEach(s -> System.out.println(s.join(",")));
long rsTime = timer.getElapsedNanoseconds();
System.out.println("RS took " + rsTime);
}
内容来源于网络,如有侵权,请联系作者删除!