当前位置: 首页>>代码示例>>Java>>正文


Java LongSummaryStatistics.getMax方法代码示例

本文整理汇总了Java中java.util.LongSummaryStatistics.getMax方法的典型用法代码示例。如果您正苦于以下问题:Java LongSummaryStatistics.getMax方法的具体用法?Java LongSummaryStatistics.getMax怎么用?Java LongSummaryStatistics.getMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.LongSummaryStatistics的用法示例。


在下文中一共展示了LongSummaryStatistics.getMax方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: minMaxDiff

import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
public static long minMaxDiff(String path) throws IOException {

        LongSummaryStatistics stats = Files.list(Paths.get(path))
                                                           .flatMap(f -> uncheckCall(() -> Files.lines(f)))
                                                           .mapToLong(l -> {
                                                               try {
                                                                   String ts = l.split(",")[3];
                                                                   if (ts.length() != 13) {
                                                                       throw new IllegalArgumentException();
                                                                   }
                                                                   return Long.valueOf(ts);
                                                               } catch (Exception ignored) {
                                                                   System.out.println("Malformed line: " + l);
                                                                   return Long.MIN_VALUE;
                                                               }
                                                           }).filter(l -> l > Long.MIN_VALUE)
                                                           .summaryStatistics();

        return stats.getMax() - stats.getMin();
    }
 
开发者ID:hazelcast,项目名称:big-data-benchmark,代码行数:21,代码来源:OutputParser.java

示例2: getSummaryText

import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
/**
 *
 * @param type the value of type
 * @param standardPulse the value of standardPulse
 * @param stats the value of stats
 * @return the String
 */
private String getSummaryText(String type, int standardPulse, LongSummaryStatistics stats) {
    StringBuilder retval = new StringBuilder();
    long low = stats.getMin();
    long high = stats.getMax();
    double average = stats.getAverage();
    retval.append("shortest ").append(type).append(" pulse:").append(low)
            .append(" tstates, longest ").append(type).append(" pulse:")
            .append(high).append(" tstates\n");
    retval.append("shortest ").append(type).append(" pulse ")
            .append(String.format("%.2f", (double)low/standardPulse*100.0))
            .append("% of expected, longest ").append(type)
            .append(" pulse ").append(String.format("%.2f", (double)high/standardPulse*100.0))
            .append("% of expected\n");
    retval.append("average ").append(type).append(" pulse:").append(String.format("%.2f", average))
            .append("\n");
    return retval.toString();
}
 
开发者ID:fmeunier,项目名称:wav2pzx,代码行数:25,代码来源:LoaderContextImpl.java

示例3: toString

import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
public String toString() {
	if (process_durations.isEmpty()) {
		return null;
	}
	
	TableList list = new TableList();
	
	LongSummaryStatistics stats = getStats();
	list.addRow("entries", stats.getCount(), 1, 0, "measured (" + max_entry_count + " max)", Locale.US);
	list.addRow("total time", stats.getSum(), 1000, 3, "sec", Locale.US);
	list.addRow("min", stats.getMin(), 1000, 3, "sec", Locale.US);
	list.addRow("average", stats.getAverage(), 1000, 3, "sec", Locale.US);
	list.addRow("max", stats.getMax(), 1000, 3, "sec", Locale.US);
	
	if (stats.getMax() != slow_duration) {
		System.err.println(slow_duration);
	}
	
	if (slow_ressource_name != null) {
		list.addRow("slower", slow_ressource_name);
	}
	
	return list.toString();
}
 
开发者ID:hdsdi3g,项目名称:MyDMAM,代码行数:25,代码来源:AJSProcessTimeLog.java

示例4: of

import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
/**
 * Return a new value object of the statistical summary, currently
 * represented by the {@code statistics} object.
 *
 * @param statistics the creating (mutable) statistics class
 * @return the statistical moments
 */
public static LongSummary of(final LongSummaryStatistics statistics) {
	return new LongSummary(
		statistics.getCount(),
		statistics.getMin(),
		statistics.getMax(),
		statistics.getSum(),
		statistics.getAverage()
	);
}
 
开发者ID:jenetics,项目名称:jenetics,代码行数:17,代码来源:LongSummary.java

示例5: SummaryStatistics

import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
public SummaryStatistics(LongSummaryStatistics statistics) {
	this(statistics.getAverage(), statistics.getMax(),
		statistics.getMin(), statistics.getCount(),
		statistics.getSum());
}
 
开发者ID:sing-group,项目名称:GC4S,代码行数:6,代码来源:ColumnSummaryTabeCellRenderer.java


注:本文中的java.util.LongSummaryStatistics.getMax方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。