Interface ExponentialHistogram.Buckets

Enclosing interface:
ExponentialHistogram

public static interface ExponentialHistogram.Buckets
Represents a bucket range of an ExponentialHistogram, either the positive or the negative range.
  • Method Details

    • iterator

      Returns:
      a BucketIterator for the populated buckets of this bucket range. The BucketIterator.scale() of the returned iterator must be the same as ExponentialHistogram.scale(). The iterator iterates on the buckets from lowest bucket index to highest bucket index, i.e. from the bucket closest to zero to the bucket closest to infinity.
    • maxBucketIndex

      OptionalLong maxBucketIndex()
      Returns:
      the highest populated bucket index, or an empty optional if no buckets are populated
    • valueCount

      long valueCount()
      Returns:
      the sum of the counts across all buckets of this range
    • bucketCount

      default int bucketCount()
      Returns the number of buckets. Note that this operation might require iterating over all buckets, and therefore is not cheap.
      Returns:
      the number of buckets
    • reverseIterator

      default BucketIterator reverseIterator()
      Returns an iterator iterating over all buckets in the opposite direction of iterator(). So the iterator iterates the buckets from the highest bucket index to the lowest, i.e. from the bucket closest to zero to the bucket closest to infinity. The BucketIterator.scale() of the returned iterator must be the same as ExponentialHistogram.scale().
      Note that depending on how the buckets are stored, this method might be expensive. It might involve copying all buckets first.