本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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()
);
}
示例5: SummaryStatistics
import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
public SummaryStatistics(LongSummaryStatistics statistics) {
this(statistics.getAverage(), statistics.getMax(),
statistics.getMin(), statistics.getCount(),
statistics.getSum());
}