Skip to content
Buy me a coffee

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.

  • IntegralSummaryStatistics

new IntSummaryStatistics(): IntSummaryStatistics

Defined in: src/util/SummaryStatistics.ts:87

Creates empty statistics (count 0).

IntSummaryStatistics

IntegralSummaryStatistics.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.

number

number

number

number

IntSummaryStatistics

IllegalArgumentException if count < 0, or count > 0 and min > max

IntegralSummaryStatistics.constructor

[INSPECT](): string

Defined in: src/util/SummaryStatistics.ts:74

Node’s util.inspect hook: console.log prints the toString() form.

string

IntegralSummaryStatistics.[INSPECT]


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.

number

void

IntegralSummaryStatistics.accept


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.

this

void

NullPointerException if other is null

IntegralSummaryStatistics.combine


getAverage(): number

Defined in: src/util/SummaryStatistics.ts:69

Returns the arithmetic mean of the recorded values, or 0 when nothing was recorded.

number

IntegralSummaryStatistics.getAverage


getCount(): number

Defined in: src/util/SummaryStatistics.ts:53

Returns the number of recorded values.

number

IntegralSummaryStatistics.getCount


getMax(): number

Defined in: src/util/SummaryStatistics.ts:65

Returns the largest recorded value, or the class’s empty maximum when nothing was recorded.

number

IntegralSummaryStatistics.getMax


getMin(): number

Defined in: src/util/SummaryStatistics.ts:61

Returns the smallest recorded value, or the class’s empty minimum when nothing was recorded.

number

IntegralSummaryStatistics.getMin


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.

number

IntegralSummaryStatistics.getSum


toString(): string

Defined in: src/util/SummaryStatistics.ts:78

Returns e.g. IntSummaryStatistics{count=2, sum=3, min=1, average=1.500000, max=2}.

string

IntegralSummaryStatistics.toString