java.util.stream.Collectors.averagingLong()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中java.util.stream.Collectors.averagingLong()方法的一些代码示例,展示了Collectors.averagingLong()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collectors.averagingLong()方法的具体详情如下:
包路径:java.util.stream.Collectors
类名称:Collectors
方法名:averagingLong

Collectors.averagingLong介绍

暂无

代码示例

代码示例来源:origin: STAMP-project/dspot

/**
 * Returns the average of a collection of double
 */
private Long average(Collection<Long> values) {
  return values.stream().collect(Collectors.averagingLong(Long::longValue)).longValue();
}

代码示例来源:origin: org.jooq/jool

@Override
public double avgLong(ToLongFunction<? super T> function) {
  return collect(Collectors.averagingLong(function));
}

代码示例来源:origin: org.jooq/jool-java-8

@Override
public double avgLong(ToLongFunction<? super T> function) {
  return collect(Collectors.averagingLong(function));
}

代码示例来源:origin: jenetics/jenetics

void update(final EvolutionResult<?, Double> result) {
  final String generation = Long.toString(result.getGeneration());
  final String bestFitness = _format.format(result.getBestFitness());
  final double age = result.getPopulation().stream()
    .collect(averagingLong(p -> p.getAge(result.getGeneration())));
  _generationTextField.setText(generation);
  _bestFitnessTextField.setText(bestFitness);
  _populationAgeTextField.setText(_format.format(age));
  _evaluationTimeTextField.setText(format(
    result.getDurations().getEvaluationDuration()
  ));
}

代码示例来源:origin: org.sakaiproject.samigo/samigo-services

batchElapsedTimes.add(batchElapsed);
currentAvgBatchElapsedTime.set(new DecimalFormat("#.00")
    .format(batchElapsedTimes.stream().collect(Collectors.averagingLong(l -> l))));
if (failure.get() == null) {
  log.debug("Item hash backfill batch flushed to database. Type: ["

代码示例来源:origin: sakaiproject/sakai

batchElapsedTimes.add(batchElapsed);
currentAvgBatchElapsedTime.set(new DecimalFormat("#.00")
    .format(batchElapsedTimes.stream().collect(Collectors.averagingLong(l -> l))));
if (failure.get() == null) {
  log.debug("Item hash backfill batch flushed to database. Type: ["

相关文章