StreamQuantileUtils class

Computes an EXACT percentile over every value fed in. This retains all values (memory grows O(n)); it is NOT an approximate, fixed-memory P² estimator despite the roadmap title. Use it when exactness matters and the stream is bounded; for unbounded streams with a memory cap, downsample before feeding values in.

Constructors

StreamQuantileUtils(double p)
Creates an estimator for the quantile at p, where p ranges from 0 to 1 (e.g. 0.5 for the median). Audited: 2026-06-12 11:26 EDT

Properties

hashCode int
The hash code for this object.
no setterinherited
p double
The target quantile in the range 0 to 1. Audited: 2026-06-12 11:26 EDT
no setter
quantile double
Current exact quantile at p (e.g. median when p is 0.5), or NaN when no values have been added. Audited: 2026-06-12 11:26 EDT
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(num value) → void
Feeds value into the estimator. The value is retained for an exact quantile; quantile sorts a copy on demand, so this is O(1) amortized. Audited: 2026-06-12 11:26 EDT
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited