Example usage for java.util.stream Collectors summarizingDouble

List of usage examples for java.util.stream Collectors summarizingDouble

Introduction

In this page you can find the example usage for java.util.stream Collectors summarizingDouble.

Prototype

public static <T> Collector<T, ?, DoubleSummaryStatistics> summarizingDouble(
        ToDoubleFunction<? super T> mapper) 

Source Link

Document

Returns a Collector which applies an double -producing mapping function to each input element, and returns summary statistics for the resulting values.

Usage

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<Product, DoubleSummaryStatistics> aggregateByProduct_serial_lazy_streams_ec() {
    Map<Product, DoubleSummaryStatistics> result = this.ecPositions.stream().collect(Collectors
            .groupingBy(Position::getProduct, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(result);//  w w w. j av  a  2  s .  co  m
    return result;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<Account, DoubleSummaryStatistics> aggregateByAccount_serial_lazy_jdk() {
    Map<Account, DoubleSummaryStatistics> accountDoubleMap = this.jdkPositions.stream().collect(Collectors
            .groupingBy(Position::getAccount, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(accountDoubleMap);
    return accountDoubleMap;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<Account, DoubleSummaryStatistics> aggregateByAccount_serial_lazy_streams_ec() {
    Map<Account, DoubleSummaryStatistics> accountDoubleMap = this.ecPositions.stream().collect(Collectors
            .groupingBy(Position::getAccount, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(accountDoubleMap);
    return accountDoubleMap;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<String, DoubleSummaryStatistics> aggregateByCategory_serial_lazy_jdk() {
    Map<String, DoubleSummaryStatistics> categoryDoubleMap = this.jdkPositions.stream().collect(Collectors
            .groupingBy(Position::getCategory, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(categoryDoubleMap);
    return categoryDoubleMap;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<String, DoubleSummaryStatistics> aggregateByCategory_serial_lazy_streams_ec() {
    Map<String, DoubleSummaryStatistics> categoryDoubleMap = this.ecPositions.stream().collect(Collectors
            .groupingBy(Position::getCategory, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(categoryDoubleMap);
    return categoryDoubleMap;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<Product, DoubleSummaryStatistics> aggregateByProduct_parallel_lazy_jdk() {
    Map<Product, DoubleSummaryStatistics> result = this.jdkPositions.parallelStream().collect(Collectors
            .groupingBy(Position::getProduct, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(result);//from w  w w.j  a v  a  2 s.  c  o  m
    return result;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<Product, DoubleSummaryStatistics> aggregateByProduct_parallel_lazy_streams_ec() {
    Map<Product, DoubleSummaryStatistics> result = this.ecPositions.parallelStream().collect(Collectors
            .groupingBy(Position::getProduct, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(result);//from  w ww.  j  av  a 2s.com
    return result;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<Account, DoubleSummaryStatistics> aggregateByAccount_parallel_lazy_jdk() {
    Map<Account, DoubleSummaryStatistics> result = this.jdkPositions.parallelStream().collect(Collectors
            .groupingBy(Position::getAccount, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(result);//from   w ww.jav  a 2 s  . c om
    return result;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<Account, DoubleSummaryStatistics> aggregateByAccount_parallel_lazy_streams_ec() {
    Map<Account, DoubleSummaryStatistics> result = this.ecPositions.parallelStream().collect(Collectors
            .groupingBy(Position::getAccount, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(result);/*from  www  .  ja  v  a 2  s  .c  o  m*/
    return result;
}

From source file:org.eclipse.collections.impl.jmh.AggregateByTest.java

@Benchmark
public Map<String, DoubleSummaryStatistics> aggregateByCategory_parallel_lazy_jdk() {
    Map<String, DoubleSummaryStatistics> result = this.jdkPositions.parallelStream().collect(Collectors
            .groupingBy(Position::getCategory, Collectors.summarizingDouble(Position::getMarketValue)));
    Assert.assertNotNull(result);/*from  www .  j  a v a 2  s.  c o m*/
    return result;
}