本文整理了Java中java.util.stream.Collectors.averagingLong()
方法的一些代码示例,展示了Collectors.averagingLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collectors.averagingLong()
方法的具体详情如下:
包路径:java.util.stream.Collectors
类名称: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: ["
内容来源于网络,如有侵权,请联系作者删除!