Class NumberRangeHistogram

  • All Implemented Interfaces:
    StatisticsReportFormat

    @API(status=EXPERIMENTAL,
         since="1.3.0")
    public class NumberRangeHistogram
    extends Histogram
    A specialized type of Histogram to divide collected numbers into range-based clusters for display in a histogram.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int buckets()
      Determines the number of buckets into which the full range of collected numbers will be clustered.
      protected java.util.List<Histogram.Bucket> cluster​(java.util.List<StatisticsEntry> entries)
      Does not make sense to override because this has the number range functionality
      protected java.util.Comparator<? super StatisticsEntry> comparator()
      Does not make sense to override since order does not matter for clustering anyway
      protected java.lang.String label​(StatisticsEntry entry)
      Does not make sense to override since these labels won't be used anyway
      protected java.lang.String rangeLabel​(java.math.BigInteger min, java.math.BigInteger max, boolean maxIncluded)
      Determines how a range of numbers is being displayed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NumberRangeHistogram

        public NumberRangeHistogram()
    • Method Detail

      • buckets

        protected int buckets()
        Determines the number of buckets into which the full range of collected numbers will be clustered.
        Returns:
        A number greater than 0
      • rangeLabel

        protected java.lang.String rangeLabel​(java.math.BigInteger min,
                                              java.math.BigInteger max,
                                              boolean maxIncluded)
        Determines how a range of numbers is being displayed.
        Parameters:
        min - The minimum value of the range (included)
        max - The maximum value of the range
        maxIncluded - If the maximum value is included in the range
        Returns:
        A string to describe the range
      • label

        protected final java.lang.String label​(StatisticsEntry entry)
        Does not make sense to override since these labels won't be used anyway
        Overrides:
        label in class Histogram
        Returns:
        A non-null string
      • comparator

        protected final java.util.Comparator<? super StatisticsEntry> comparator()
        Does not make sense to override since order does not matter for clustering anyway
        Overrides:
        comparator in class Histogram
        Returns:
        A comparator instance.
      • cluster

        protected final java.util.List<Histogram.Bucket> cluster​(java.util.List<StatisticsEntry> entries)
        Does not make sense to override because this has the number range functionality
        Overrides:
        cluster in class Histogram
        Parameters:
        entries - An already sorted list of entries
        Returns:
        A sorted list of buckets