IntSummaryStatistics
Defined in: src/util/SummaryStatistics.ts:84
count/sum/min/max/average of int values. Empty: min = 2^31-1, max = -2^31, average = 0.
Extends
Section titled “Extends”IntegralSummaryStatistics
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IntSummaryStatistics():
IntSummaryStatistics
Defined in: src/util/SummaryStatistics.ts:87
Creates empty statistics (count 0).
Returns
Section titled “Returns”IntSummaryStatistics
Overrides
Section titled “Overrides”IntegralSummaryStatistics.constructor
Constructor
Section titled “Constructor”new IntSummaryStatistics(
count,min,max,sum):IntSummaryStatistics
Defined in: src/util/SummaryStatistics.ts:92
Creates statistics with the given state. With count 0 the other arguments are ignored.
Parameters
Section titled “Parameters”number
number
number
number
Returns
Section titled “Returns”IntSummaryStatistics
Throws
Section titled “Throws”IllegalArgumentException if count < 0, or count > 0 and min > max
Overrides
Section titled “Overrides”IntegralSummaryStatistics.constructor
Methods
Section titled “Methods”[INSPECT]()
Section titled “[INSPECT]()”[INSPECT]():
string
Defined in: src/util/SummaryStatistics.ts:74
Node’s util.inspect hook: console.log prints the toString() form.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.[INSPECT]
accept()
Section titled “accept()”accept(
value):void
Defined in: src/util/SummaryStatistics.ts:33
Records value: increments the count, adds it to the sum and updates min and max.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.accept
combine()
Section titled “combine()”combine(
other):void
Defined in: src/util/SummaryStatistics.ts:44
Merges the state of other into this one, as if every value it recorded had been recorded here.
Parameters
Section titled “Parameters”this
Returns
Section titled “Returns”void
Throws
Section titled “Throws”NullPointerException if other is null
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.combine
getAverage()
Section titled “getAverage()”getAverage():
number
Defined in: src/util/SummaryStatistics.ts:69
Returns the arithmetic mean of the recorded values, or 0 when nothing was recorded.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.getAverage
getCount()
Section titled “getCount()”getCount():
number
Defined in: src/util/SummaryStatistics.ts:53
Returns the number of recorded values.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.getCount
getMax()
Section titled “getMax()”getMax():
number
Defined in: src/util/SummaryStatistics.ts:65
Returns the largest recorded value, or the class’s empty maximum when nothing was recorded.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.getMax
getMin()
Section titled “getMin()”getMin():
number
Defined in: src/util/SummaryStatistics.ts:61
Returns the smallest recorded value, or the class’s empty minimum when nothing was recorded.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.getMin
getSum()
Section titled “getSum()”getSum():
number
Defined in: src/util/SummaryStatistics.ts:57
Returns the sum of the recorded values (0 when empty). The sum is a JS number, so it is exact up to 2^53.
Returns
Section titled “Returns”number
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.getSum
toString()
Section titled “toString()”toString():
string
Defined in: src/util/SummaryStatistics.ts:78
Returns e.g. IntSummaryStatistics{count=2, sum=3, min=1, average=1.500000, max=2}.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”IntegralSummaryStatistics.toString