Class ClassicHistogramBuckets

Object
ClassicHistogramBuckets
All Implemented Interfaces:
Iterable<ClassicHistogramBucket>

Immutable container for histogram buckets with fixed bucket boundaries. Note that the counts are not cumulative.
  • Field Details

    • EMPTY

      public static final ClassicHistogramBuckets EMPTY
      Used in native histograms to indicate that no classic histogram buckets are present.
  • Method Details

    • of

      public static ClassicHistogramBuckets of(List<Double> upperBounds, List<? extends Number> counts)
      To create new ClassicHistogramBuckets, you can either use one of the static of(...) methods, or use builder().

      This method will create a copy of upperBounds and counts.

      Parameters:
      upperBounds - must have the same length as counts. Must not contain duplicates. Must contain at least Double.POSITIVE_INFINITY for the +Inf bucket. An upper bound must not be Double.NaN. The upperBounds array does not need to be sorted.
      counts - must have the same length as upperBounds. The entry at index i is the count for the upperBound at index i. For each count, Number.longValue() is called to get the value. Counts are not cumulative. Counts must not be negative.
    • of

      public static ClassicHistogramBuckets of(double[] upperBounds, Number[] counts)
      To create new ClassicHistogramBuckets, you can either use one of the static of(...) methods, or use builder().

      This method will create a copy of upperBounds and counts.

      Parameters:
      upperBounds - must have the same length as counts. Must not contain duplicates. Must contain at least Double.POSITIVE_INFINITY for the +Inf bucket. An upper bound must not be Double.NaN. The upperBounds array does not need to be sorted.
      counts - must have the same length as upperBounds. The entry at index i is the count for the upperBound at index i. For each count, Number.longValue() is called to get the value. Counts are not cumulative. Counts must not be negative.
    • of

      public static ClassicHistogramBuckets of(double[] upperBounds, long[] counts)
      To create new ClassicHistogramBuckets, you can either use one of the static of(...) methods, or use builder().

      This method will create a copy of upperBounds and counts.

      Parameters:
      upperBounds - must have the same length as counts. Must not contain duplicates. Must contain at least Double.POSITIVE_INFINITY for the +Inf bucket. An upper bound must not be Double.NaN. The upperBounds array does not need to be sorted.
      counts - must have the same length as upperBounds. The entry at index i is the count for the upperBound at index i. Counts are not cumulative. Counts must not be negative.
    • size

      public int size()
    • getUpperBound

      public double getUpperBound(int i)
    • getCount

      public long getCount(int i)
      The count is not cumulative.
    • isEmpty

      public boolean isEmpty()
    • iterator

      Specified by:
      iterator in interface Iterable<ClassicHistogramBucket>
    • stream

    • builder

      To create new ClassicHistogramBuckets, you can either use one of the static of(...) methods, or use builder().