JsHistogramIterator.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import JsHistogram from "./JsHistogram";
  2. import HistogramIterationValue from "./HistogramIterationValue";
  3. /**
  4. * Used for iterating through histogram values.
  5. */
  6. declare abstract class JsHistogramIterator {
  7. histogram: JsHistogram;
  8. savedHistogramTotalRawCount: number;
  9. currentIndex: number;
  10. currentValueAtIndex: number;
  11. nextValueAtIndex: number;
  12. prevValueIteratedTo: number;
  13. totalCountToPrevIndex: number;
  14. totalCountToCurrentIndex: number;
  15. totalValueToCurrentIndex: number;
  16. arrayTotalCount: number;
  17. countAtThisValue: number;
  18. private freshSubBucket;
  19. currentIterationValue: HistogramIterationValue;
  20. resetIterator(histogram: JsHistogram): void;
  21. /**
  22. * Returns true if the iteration has more elements. (In other words, returns true if next would return an
  23. * element rather than throwing an exception.)
  24. *
  25. * @return true if the iterator has more elements.
  26. */
  27. hasNext(): boolean;
  28. /**
  29. * Returns the next element in the iteration.
  30. *
  31. * @return the {@link HistogramIterationValue} associated with the next element in the iteration.
  32. */
  33. next(): HistogramIterationValue;
  34. abstract incrementIterationLevel(): void;
  35. /**
  36. * @return true if the current position's data should be emitted by the iterator
  37. */
  38. abstract reachedIterationLevel(): boolean;
  39. getPercentileIteratedTo(): number;
  40. getPercentileIteratedFrom(): number;
  41. getValueIteratedTo(): number;
  42. private exhaustedSubBuckets;
  43. incrementSubBucket(): void;
  44. }
  45. export default JsHistogramIterator;