Class HistogramBucketCountFormatters
- java.lang.Object
-
- com.pervasivecode.utils.stats.histogram.HistogramBucketCountFormatters
-
public class HistogramBucketCountFormatters extends Object
Factory methods for use withHistogramFormat.Builder.setBucketCountFormatter(BiFunction)
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BiFunction<Long,Long,String>
percentFormatter(NumberFormat percentFormat)
Make a BiFunction that can be used to format histogram bucket count values as a percentage of the total number counted by the histogram.static BiFunction<Long,Long,String>
percentFormatter(Locale formatLocale)
Make a BiFunction that can be used to format histogram bucket count values as a percentage of the total number counted by the histogram.
-
-
-
Method Detail
-
percentFormatter
public static BiFunction<Long,Long,String> percentFormatter(NumberFormat percentFormat)
Make a BiFunction that can be used to format histogram bucket count values as a percentage of the total number counted by the histogram.If you don't need to configure the default percentage formatter, you can use the
percentFormatter(Locale)
version of this method instead.- Parameters:
percentFormat
- The localized formatter that will format a number between 0.0 and 1.0 as a percentage.- Returns:
- A BiFunction wrapping the provided percentFormat.
-
percentFormatter
public static BiFunction<Long,Long,String> percentFormatter(Locale formatLocale)
Make a BiFunction that can be used to format histogram bucket count values as a percentage of the total number counted by the histogram.This method obtains the default percentage formatter for a
Locale
. If you need to configure the percentage formatter, you can use thepercentFormatter(NumberFormat)
version of this method instead.- Parameters:
formatLocale
- The locale to use when obtaining a default percentageNumberFormat
.- Returns:
- A BiFunction wrapping the default percent format for the specified Locale.
-
-