@Override public boolean hasNext() { if (super.hasNext()) return true; // We want one additional last step to 100% if (!reachedLastRecordedValue && (arrayTotalCount > 0)) { percentileLevelToIterateTo = 100.0; reachedLastRecordedValue = true; return true; } return false; }
private void reset(final AbstractHistogram histogram, final int percentileTicksPerHalfDistance) { super.resetIterator(histogram); this.percentileTicksPerHalfDistance = percentileTicksPerHalfDistance; this.percentileLevelToIterateTo = 0.0; this.percentileLevelToIterateFrom = 0.0; this.reachedLastRecordedValue = false; }
public HistogramIterationValue next() { while (!exhaustedSubBuckets()) { countAtThisValue = histogram.getCountAtIndex(currentIndex); if (freshSubBucket) { // Don't add unless we've incremented since last bucket... freshSubBucket = false; if (reachedIterationLevel()) { long valueIteratedTo = getValueIteratedTo(); currentIterationValue.set(valueIteratedTo, prevValueIteratedTo, countAtThisValue, (totalCountToCurrentIndex - totalCountToPrevIndex), totalCountToCurrentIndex, totalValueToCurrentIndex, ((100.0 * totalCountToCurrentIndex) / arrayTotalCount), getPercentileIteratedTo(), integerToDoubleValueConversionRatio); prevValueIteratedTo = valueIteratedTo; totalCountToPrevIndex = totalCountToCurrentIndex; incrementIterationLevel(); if (histogram.getTotalCount() != arrayTotalCount) { throw new ConcurrentModificationException(); incrementSubBucket();
public HistogramIterationValue next() { while (!exhaustedSubBuckets()) { countAtThisValue = histogram.getCountAtIndex(currentIndex); if (freshSubBucket) { // Don't add unless we've incremented since last bucket... freshSubBucket = false; if (reachedIterationLevel()) { long valueIteratedTo = getValueIteratedTo(); currentIterationValue.set(valueIteratedTo, prevValueIteratedTo, countAtThisValue, (totalCountToCurrentIndex - totalCountToPrevIndex), totalCountToCurrentIndex, totalValueToCurrentIndex, ((100.0 * totalCountToCurrentIndex) / arrayTotalCount), getPercentileIteratedTo(), integerToDoubleValueConversionRatio); prevValueIteratedTo = valueIteratedTo; totalCountToPrevIndex = totalCountToCurrentIndex; incrementIterationLevel(); if (histogram.getTotalCount() != arrayTotalCount) { throw new ConcurrentModificationException(); incrementSubBucket();
private void reset(final AbstractHistogram histogram) { super.resetIterator(histogram); visitedIndex = -1; }
@Override public boolean hasNext() { if (super.hasNext()) { return true; } // If the next iteration will not move to the next sub bucket index (which is empty if // if we reached this point), then we are not yet done iterating (we want to iterate // until we are no longer on a value that has a count, rather than util we first reach // the last value that has a count. The difference is subtle but important)... // When this is called, we're about to begin the "next" iteration, so // currentStepHighestValueReportingLevel has already been incremented, and we use it // without incrementing its value. return (currentStepHighestValueReportingLevel < nextValueAtIndex); }
private void reset(final AbstractHistogram histogram) { super.resetIterator(histogram); visitedIndex = -1; }
@Override public boolean hasNext() { if (super.hasNext()) { return true; } // If the next iterate will not move to the next sub bucket index (which is empty if // if we reached this point), then we are not yet done iterating (we want to iterate // until we are no longer on a value that has a count, rather than util we first reach // the last value that has a count. The difference is subtle but important)... return (histogram.lowestEquivalentValue((long) nextValueReportingLevel) < nextValueAtIndex); }
private void reset(final AbstractHistogram histogram, final long valueUnitsInFirstBucket, final double logBase) { super.resetIterator(histogram); this.logBase = logBase; this.valueUnitsInFirstBucket = valueUnitsInFirstBucket; nextValueReportingLevel = valueUnitsInFirstBucket; this.currentStepHighestValueReportingLevel = ((long) nextValueReportingLevel) - 1; this.currentStepLowestValueReportingLevel = histogram.lowestEquivalentValue(currentStepHighestValueReportingLevel); }
@Override public boolean hasNext() { if (super.hasNext()) return true; // We want one additional last step to 100% if (!reachedLastRecordedValue && (arrayTotalCount > 0)) { percentileLevelToIterateTo = 100.0; reachedLastRecordedValue = true; return true; } return false; }
private void reset(final AbstractHistogram histogram, final long valueUnitsPerBucket) { super.resetIterator(histogram); this.valueUnitsPerBucket = valueUnitsPerBucket; this.currentStepHighestValueReportingLevel = valueUnitsPerBucket - 1; this.currentStepLowestValueReportingLevel = histogram.lowestEquivalentValue(currentStepHighestValueReportingLevel); }
@Override public boolean hasNext() { if (super.hasNext()) { return true; } // If the next iteration will not move to the next sub bucket index (which is empty if // if we reached this point), then we are not yet done iterating (we want to iterate // until we are no longer on a value that has a count, rather than util we first reach // the last value that has a count. The difference is subtle but important)... // When this is called, we're about to begin the "next" iteration, so // currentStepHighestValueReportingLevel has already been incremented, and we use it // without incrementing its value. return (currentStepHighestValueReportingLevel < nextValueAtIndex); }
private void reset(final AbstractHistogram histogram, final int percentileTicksPerHalfDistance) { super.resetIterator(histogram); this.percentileTicksPerHalfDistance = percentileTicksPerHalfDistance; this.percentileLevelToIterateTo = 0.0; this.percentileLevelToIterateFrom = 0.0; this.reachedLastRecordedValue = false; }
@Override public boolean hasNext() { if (super.hasNext()) { return true; } // If the next iterate will not move to the next sub bucket index (which is empty if // if we reached this point), then we are not yet done iterating (we want to iterate // until we are no longer on a value that has a count, rather than util we first reach // the last value that has a count. The difference is subtle but important)... return (histogram.lowestEquivalentValue((long) nextValueReportingLevel) < nextValueAtIndex); }
private void reset(final AbstractHistogram histogram) { super.resetIterator(histogram); visitedIndex = -1; }
private void reset(final AbstractHistogram histogram) { super.resetIterator(histogram); visitedIndex = -1; }
private void reset(final AbstractHistogram histogram, final long valueUnitsPerBucket) { super.resetIterator(histogram); this.valueUnitsPerBucket = valueUnitsPerBucket; this.currentStepHighestValueReportingLevel = valueUnitsPerBucket - 1; this.currentStepLowestValueReportingLevel = histogram.lowestEquivalentValue(currentStepHighestValueReportingLevel); }
private void reset(final AbstractHistogram histogram, final long valueUnitsInFirstBucket, final double logBase) { super.resetIterator(histogram); this.logBase = logBase; this.valueUnitsInFirstBucket = valueUnitsInFirstBucket; nextValueReportingLevel = valueUnitsInFirstBucket; this.currentStepHighestValueReportingLevel = ((long) nextValueReportingLevel) - 1; this.currentStepLowestValueReportingLevel = histogram.lowestEquivalentValue(currentStepHighestValueReportingLevel); }