本文整理了Java中cyclops.reactive.ReactiveSeq.unzip
方法的一些代码示例,展示了ReactiveSeq.unzip
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReactiveSeq.unzip
方法的具体详情如下:
包路径:cyclops.reactive.ReactiveSeq
类名称:ReactiveSeq
方法名:unzip
[英]Unzip a zipped Stream
unzip(ReactiveSeq.of(new Tuple2(1, "a"), new Tuple2(2, "b"), new Tuple2(3, "c")))
[中]解压压缩流
unzip(ReactiveSeq.of(new Tuple2(1, "a"), new Tuple2(2, "b"), new Tuple2(3, "c")))
代码示例来源:origin: aol/cyclops
static <T, U> Tuple2<LazySeq<T>, LazySeq<U>> unzip(final LazySeq<Tuple2<T, U>> sequence) {
return ReactiveSeq.unzip(sequence.stream()).transform((a, b)->Tuple.tuple(fromStream(a),fromStream(b)));
}
static <T> LazySeq<T> generate(Supplier<T> s){
代码示例来源:origin: aol/cyclops
public static <T, U> Tuple2<Vector<T>, Vector<U>> unzip(final Vector<Tuple2<T, U>> sequence) {
return ReactiveSeq.unzip(sequence.stream()).transform((a, b)->Tuple.tuple(fromStream(a),fromStream(b)));
}
public static <T> Vector<T> generate(Supplier<T> s, int max){
代码示例来源:origin: aol/cyclops
public static <T, U> Tuple2<HashSet<T>, HashSet<U>> unzip(final HashSet<Tuple2<T, U>> sequence) {
return ReactiveSeq.unzip(sequence.stream()).transform((a, b)-> Tuple.tuple(fromStream(a),fromStream(b)));
}
public static <T> HashSet<T> generate(Supplier<T> s, int max){
代码示例来源:origin: aol/cyclops
static <T, U> Tuple2<IntMap<T>, IntMap<U>> unzip(final LazySeq<Tuple2<T, U>> sequence) {
return ReactiveSeq.unzip(sequence.stream()).transform((a, b)->Tuple.tuple(fromStream(a),fromStream(b)));
}
static <T> IntMap<T> generate(Supplier<T> s, int max){
代码示例来源:origin: aol/cyclops
static <T, U> Tuple2<Seq<T>, Seq<U>> unzip(final LazySeq<Tuple2<T, U>> sequence) {
return ReactiveSeq.unzip(sequence.stream()).transform((a, b)->Tuple.tuple(fromStream(a),fromStream(b)));
}
static <T> Seq<T> generate(Supplier<T> s, int max){
代码示例来源:origin: aol/cyclops
static <T, U> Tuple2<TreeSet<T>, TreeSet<U>> unzip(final TreeSet<Tuple2<T, U>> sequence) {
return ReactiveSeq.unzip(sequence.stream()).transform((a, b)-> Tuple.tuple(fromStream(a,Comparators.naturalOrderIdentityComparator()),fromStream(b,Comparators.naturalOrderIdentityComparator())));
}
static <T> TreeSet<T> generate(Supplier<T> s, int max){
代码示例来源:origin: aol/cyclops
@Test
public void testUnzip() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzip() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzip() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzipWithLimits() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().limit(2).toList().containsAll(Arrays.asList(1, 2)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzip() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzip() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzip() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzip() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertThat(u1._1().toList(), equalTo(asList(1, 2, 3)));
assertThat(u1._2().toList(), equalTo(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzipWithLimits() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().limit(2).toList().containsAll(Arrays.asList(1, 2)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzipWithLimits() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().limit(2).toList().containsAll(Arrays.asList(1, 2)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzipWithLimits() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().limit(2).to(Streamable::fromStream).toList().containsAll(Arrays.asList(1, 2)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzipWithLimits() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> ReactiveSeq.of(
tuple(1, "a"),tuple(2, "b"),tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s
.get());
assertTrue(u1._1().limit(2).toList().containsAll(Arrays.asList(1, 2)));
assertTrue(u1._2().toList().containsAll(Arrays.asList("a", "b", "c")));
}
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzipWithLimits() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().limit(2).toList().containsAll(Arrays.asList(1, 2)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
代码示例来源:origin: aol/cyclops
@Test
public void testUnzipWithLimits() {
Supplier<ReactiveSeq<Tuple2<Integer, String>>> s = () -> of(Tuple.tuple(1, "a"), Tuple.tuple(2, "b"), Tuple.tuple(3, "c"));
Tuple2<ReactiveSeq<Integer>, ReactiveSeq<String>> u1 = ReactiveSeq.unzip(s.get());
assertTrue(u1._1().limit(2).toList().containsAll(Arrays.asList(1, 2)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
}
内容来源于网络,如有侵权,请联系作者删除!