本文整理了Java中cyclops.reactive.ReactiveSeq.mapToLong
方法的一些代码示例,展示了ReactiveSeq.mapToLong
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReactiveSeq.mapToLong
方法的具体详情如下:
包路径:cyclops.reactive.ReactiveSeq
类名称:ReactiveSeq
方法名:mapToLong
暂无
代码示例来源:origin: aol/cyclops
@Override
default LongStream mapToLong(ToLongFunction<? super T> mapper){
return stream().mapToLong(mapper);
}
代码示例来源:origin: aol/cyclops
default long sumLong(ToLongFunction<T> fn){
return stream().mapToLong(fn).sum();
}
代码示例来源:origin: aol/cyclops
@Deprecated //moved to cyclops.companion.Functions
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
return a->fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}
代码示例来源:origin: aol/cyclops
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
return a->ReactiveSeq.fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}
代码示例来源:origin: aol/cyclops
/**
* Peform intermediate operations on a primitive IntStream (gives improved performance when working with Integers)
* If this ReactiveSeq has an OfInt Spliterator it will be converted directly to an IntStream,
* otherwise the provided conversion function will be used.
*
* <pre>
* {@code
* ReactiveSeq.range(1, 1000)
* .longs(i->i.longValue(),s->s.map(i->i*2).filter(i->i<500))
.size(),
//249
*
* </pre>
*
*
* @param fn
* @param mapper
* @return
*/
default ReactiveSeq<Long> longs(ToLongFunction<? super T> fn,Function<? super LongStream, ? extends LongStream> mapper){
return ReactiveSeq.fromSpliterator(mapper.apply(mapToLong(fn)).spliterator());
}
代码示例来源:origin: aol/cyclops
@Test
public void mapToLong() {
assertThat(of("1","2","3","4").stream().mapToLong(it -> Long.valueOf(it)).max().getAsLong(),equalTo(4l));
}
代码示例来源:origin: aol/cyclops
@Test
public void mapToLong() {
assertThat(of("1","2","3","4").mapToLong(it -> Long.valueOf(it)).max().getAsLong(),equalTo(4l));
}
代码示例来源:origin: aol/cyclops
@Test
public void mapToLong() {
assertThat(of("1","2","3","4").mapToLong(it -> Long.valueOf(it)).max().getAsLong(),equalTo(4l));
}
代码示例来源:origin: aol/cyclops
@Test
public void mapToLong() {
assertThat(of("1","2","3","4").mapToLong(it -> Long.valueOf(it)).max().getAsLong(),equalTo(4l));
}
代码示例来源:origin: aol/cyclops
@Test
public void mapToLong() {
assertThat(of("1","2","3","4").mapToLong(it -> Long.valueOf(it)).max().getAsLong(),equalTo(4l));
}
代码示例来源:origin: aol/cyclops
@Test
public void mapToLong() {
assertThat(of("1","2","3","4").mapToLong(it -> Long.valueOf(it)).max().getAsLong(),equalTo(4l));
}
代码示例来源:origin: com.oath.cyclops/cyclops
@Override
default LongStream mapToLong(ToLongFunction<? super T> mapper){
return stream().mapToLong(mapper);
}
代码示例来源:origin: com.oath.cyclops/cyclops-futurestream
@Override
default LongStream mapToLong(final ToLongFunction<? super U> mapper) {
return stream().mapToLong(mapper);
}
代码示例来源:origin: com.oath.cyclops/cyclops
default long sumLong(ToLongFunction<T> fn){
return stream().mapToLong(fn).sum();
}
代码示例来源:origin: com.oath.cyclops/cyclops
@Deprecated //moved to cyclops.companion.Functions
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
return a->fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}
代码示例来源:origin: com.oath.cyclops/cyclops
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> concatLongs( ReactiveSeq<Long> b){
return a->ReactiveSeq.fromSpliterator(LongStream.concat(a.mapToLong(i->i),b.mapToLong(i->i)).spliterator());
}
代码示例来源:origin: com.oath.cyclops/cyclops
/**
* Peform intermediate operations on a primitive IntStream (gives improved performance when working with Integers)
* If this ReactiveSeq has an OfInt Spliterator it will be converted directly to an IntStream,
* otherwise the provided conversion function will be used.
*
* <pre>
* {@code
* ReactiveSeq.range(1, 1000)
* .longs(i->i.longValue(),s->s.map(i->i*2).filter(i->i<500))
.size(),
//249
*
* </pre>
*
*
* @param fn
* @param mapper
* @return
*/
default ReactiveSeq<Long> longs(ToLongFunction<? super T> fn,Function<? super LongStream, ? extends LongStream> mapper){
return ReactiveSeq.fromSpliterator(mapper.apply(mapToLong(fn)).spliterator());
}
内容来源于网络,如有侵权,请联系作者删除!