本文整理汇总了Java中java.util.LongSummaryStatistics.getCount方法的典型用法代码示例。如果您正苦于以下问题:Java LongSummaryStatistics.getCount方法的具体用法?Java LongSummaryStatistics.getCount怎么用?Java LongSummaryStatistics.getCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.LongSummaryStatistics
的用法示例。
在下文中一共展示了LongSummaryStatistics.getCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: completeDataBlock
import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
@Override
public void completeDataBlock() {
if(pulseLengths.isEmpty()) {
return;
}
ImmutableList<Byte> data = dataBuilder.getData();
int numBitsInLastByte = dataBuilder.getNumBitsInCurrentByte();
LongSummaryStatistics zeroStats = getSummaryStats(zeroPulses);
Logger.getLogger(LoaderContextImpl.class.getName()).log(Level.INFO, getSummaryText("zero", ZERO, zeroStats));
LongSummaryStatistics oneStats = getSummaryStats (onePulses);
Logger.getLogger(LoaderContextImpl.class.getName()).log(Level.INFO, getSummaryText("one", ONE, oneStats));
// TODO: use average ZERO pulse length unless idealised, actually - only create data block if average zero pulse
// credibly resembles the standard zero pulse, the recognition routines seem to be close to handling standard
// speed loaders where the standard routines just have shorter timing constants than the standard ROM routines
if(data.isEmpty() ||
(!PulseUtils.equalWithinResolution(ZERO, zeroStats.getAverage(), resolution) && zeroStats.getCount() != 0) ||
// TODO: use average ONE pulse length unless idealised, actually - only create data block if average one pulse
// credibly resembles the standard one pulse, the recognition routines seem to be close to handling standard
// speed loaders where the standard routines just have shorter timing constants than the standard ROM routines
(!PulseUtils.equalWithinResolution(ONE, oneStats.getAverage(), resolution) && oneStats.getCount() != 0)) {
// Something was wrong with this block as a data block, try again to record it as a plain pulse block
completePulseBlock(false);
return;
}
PZXDataBlock newBlock =
new PZXDataBlock(getPulseListForCurrentPulses(), numBitsInLastByte, data);
Logger.getLogger(LoaderContextImpl.class.getName()).log(Level.INFO, newBlock.getSummary());
loaderResult.add(newBlock);
pulseLengths.clear();
resetBlock();
}
示例2: 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()
);
}
示例3: SummaryStatistics
import java.util.LongSummaryStatistics; //导入方法依赖的package包/类
public SummaryStatistics(LongSummaryStatistics statistics) {
this(statistics.getAverage(), statistics.getMax(),
statistics.getMin(), statistics.getCount(),
statistics.getSum());
}