source: trip-planner-front/node_modules/hdr-histogram-js/dist/RecordedValuesIterator.js@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"use strict";
2/*
3 * This is a TypeScript port of the original Java version, which was written by
4 * Gil Tene as described in
5 * https://github.com/HdrHistogram/HdrHistogram
6 * and released to the public domain, as explained at
7 * http://creativecommons.org/publicdomain/zero/1.0/
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10const JsHistogramIterator_1 = require("./JsHistogramIterator");
11/**
12 * Used for iterating through all recorded histogram values using the finest granularity steps supported by the
13 * underlying representation. The iteration steps through all non-zero recorded value counts, and terminates when
14 * all recorded histogram values are exhausted.
15 */
16class RecordedValuesIterator extends JsHistogramIterator_1.default {
17 /**
18 * @param histogram The histogram this iterator will operate on
19 */
20 constructor(histogram) {
21 super();
22 this.doReset(histogram);
23 }
24 /**
25 * Reset iterator for re-use in a fresh iteration over the same histogram data set.
26 */
27 reset() {
28 this.doReset(this.histogram);
29 }
30 doReset(histogram) {
31 super.resetIterator(histogram);
32 this.visitedIndex = -1;
33 }
34 incrementIterationLevel() {
35 this.visitedIndex = this.currentIndex;
36 }
37 reachedIterationLevel() {
38 const currentCount = this.histogram.getCountAtIndex(this.currentIndex);
39 return currentCount != 0 && this.visitedIndex !== this.currentIndex;
40 }
41}
42exports.default = RecordedValuesIterator;
43//# sourceMappingURL=RecordedValuesIterator.js.map
Note: See TracBrowser for help on using the repository browser.