/** * Get the count of recorded values within a range of value levels (inclusive to within the histogram's resolution). * * @param lowValue The lower value bound on the range for which * to provide the recorded count. Will be rounded down with * {@link DoubleHistogram#lowestEquivalentValue lowestEquivalentValue}. * @param highValue The higher value bound on the range for which to provide the recorded count. * Will be rounded up with {@link DoubleHistogram#highestEquivalentValue highestEquivalentValue}. * @return the total count of values recorded in the histogram within the value range that is * {@literal >=} lowestEquivalentValue(<i>lowValue</i>) and {@literal <=} highestEquivalentValue(<i>highValue</i>) */ public double getCountBetweenValues(final double lowValue, final double highValue) throws ArrayIndexOutOfBoundsException { return integerValuesHistogram.getCountBetweenValues( (long)(lowValue * getDoubleToIntegerValueConversionRatio()), (long)(highValue * getDoubleToIntegerValueConversionRatio()) ); }
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. * @param valueUnitsInFirstBucket the size (in value units) of the first value bucket step * @param logBase the multiplier by which the bucket size is expanded in each iteration step. */ public void reset(final double valueUnitsInFirstBucket, final double logBase) { integerLogarithmicIterator.reset( (long) (valueUnitsInFirstBucket * histogram.getDoubleToIntegerValueConversionRatio()), logBase ); }
/** * Get the count of recorded values at a specific value (to within the histogram resolution at the value level). * * @param value The value for which to provide the recorded count * @return The total count of values recorded in the histogram within the value range that is * {@literal >=} lowestEquivalentValue(<i>value</i>) and {@literal <=} highestEquivalentValue(<i>value</i>) */ public long getCountAtValue(final double value) throws ArrayIndexOutOfBoundsException { return integerValuesHistogram.getCountAtValue((long)(value * getDoubleToIntegerValueConversionRatio())); }
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. * @param valueUnitsPerBucket The size (in value units) of each bucket iteration. */ public void reset(final double valueUnitsPerBucket) { integerLinearIterator.reset((long) (valueUnitsPerBucket * histogram.getDoubleToIntegerValueConversionRatio())); }
/** * Get the percentile at a given value. * The percentile returned is the percentile of values recorded in the histogram that are smaller * than or equivalent to the given value. * <p> * Note that two values are "equivalent" in this statement if * {@link org.HdrHistogram.DoubleHistogram#valuesAreEquivalent} would return true. * * @param value The value for which to return the associated percentile * @return The percentile of values recorded in the histogram that are smaller than or equivalent * to the given value. */ public double getPercentileAtOrBelowValue(final double value) { return integerValuesHistogram.getPercentileAtOrBelowValue((long)(value * getDoubleToIntegerValueConversionRatio())); }
/** * Get the size (in value units) of the range of values that are equivalent to the given value within the * histogram's resolution. Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The lowest value that is equivalent to the given value within the histogram's resolution. */ public double sizeOfEquivalentValueRange(final double value) { return integerValuesHistogram.sizeOfEquivalentValueRange((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get a value that lies in the middle (rounded up) of the range of values equivalent the given value. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The value lies in the middle (rounded up) of the range of values equivalent the given value. */ public double medianEquivalentValue(final double value) { return integerValuesHistogram.medianEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get the next value that is not equivalent to the given value within the histogram's resolution. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The next value that is not equivalent to the given value within the histogram's resolution. */ public double nextNonEquivalentValue(final double value) { return integerValuesHistogram.nextNonEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * @param histogram The histogram this iterator will operate on * @param valueUnitsPerBucket The size (in value units) of each bucket iteration. */ public DoubleLinearIterator(final DoubleHistogram histogram, final double valueUnitsPerBucket) { this.histogram = histogram; integerLinearIterator = new LinearIterator( histogram.integerValuesHistogram, (long) (valueUnitsPerBucket * histogram.getDoubleToIntegerValueConversionRatio()) ); iterationValue = new DoubleHistogramIterationValue(integerLinearIterator.currentIterationValue); }
/** * Get the lowest value that is equivalent to the given value within the histogram's resolution. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The lowest value that is equivalent to the given value within the histogram's resolution. */ public double lowestEquivalentValue(final double value) { return integerValuesHistogram.lowestEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * @param histogram The histogram this iterator will operate on * @param valueUnitsInFirstBucket the size (in value units) of the first value bucket step * @param logBase the multiplier by which the bucket size is expanded in each iteration step. */ public DoubleLogarithmicIterator(final DoubleHistogram histogram, final double valueUnitsInFirstBucket, final double logBase) { this.histogram = histogram; integerLogarithmicIterator = new LogarithmicIterator( histogram.integerValuesHistogram, (long) (valueUnitsInFirstBucket * histogram.getDoubleToIntegerValueConversionRatio()), logBase ); iterationValue = new DoubleHistogramIterationValue(integerLogarithmicIterator.currentIterationValue); }
/** * Get the count of recorded values at a specific value (to within the histogram resolution at the value level). * * @param value The value for which to provide the recorded count * @return The total count of values recorded in the histogram within the value range that is * {@literal >=} lowestEquivalentValue(<i>value</i>) and {@literal <=} highestEquivalentValue(<i>value</i>) */ public long getCountAtValue(final double value) throws ArrayIndexOutOfBoundsException { return integerValuesHistogram.getCountAtValue((long)(value * getDoubleToIntegerValueConversionRatio())); }
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. * @param valueUnitsInFirstBucket the size (in value units) of the first value bucket step * @param logBase the multiplier by which the bucket size is expanded in each iteration step. */ public void reset(final double valueUnitsInFirstBucket, final double logBase) { integerLogarithmicIterator.reset( (long) (valueUnitsInFirstBucket * histogram.getDoubleToIntegerValueConversionRatio()), logBase ); }
/** * Reset iterator for re-use in a fresh iteration over the same histogram data set. * @param valueUnitsPerBucket The size (in value units) of each bucket iteration. */ public void reset(final double valueUnitsPerBucket) { integerLinearIterator.reset((long) (valueUnitsPerBucket * histogram.getDoubleToIntegerValueConversionRatio())); }
/** * Get the next value that is not equivalent to the given value within the histogram's resolution. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The next value that is not equivalent to the given value within the histogram's resolution. */ public double nextNonEquivalentValue(final double value) { return integerValuesHistogram.nextNonEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get the lowest value that is equivalent to the given value within the histogram's resolution. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The lowest value that is equivalent to the given value within the histogram's resolution. */ public double lowestEquivalentValue(final double value) { return integerValuesHistogram.lowestEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get the size (in value units) of the range of values that are equivalent to the given value within the * histogram's resolution. Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The lowest value that is equivalent to the given value within the histogram's resolution. */ public double sizeOfEquivalentValueRange(final double value) { return integerValuesHistogram.sizeOfEquivalentValueRange((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * Get a value that lies in the middle (rounded up) of the range of values equivalent the given value. * Where "equivalent" means that value samples recorded for any two * equivalent values are counted in a common total count. * * @param value The given value * @return The value lies in the middle (rounded up) of the range of values equivalent the given value. */ public double medianEquivalentValue(final double value) { return integerValuesHistogram.medianEquivalentValue((long)(value * getDoubleToIntegerValueConversionRatio())) * getIntegerToDoubleValueConversionRatio(); }
/** * @param histogram The histogram this iterator will operate on * @param valueUnitsPerBucket The size (in value units) of each bucket iteration. */ public DoubleLinearIterator(final DoubleHistogram histogram, final double valueUnitsPerBucket) { this.histogram = histogram; integerLinearIterator = new LinearIterator( histogram.integerValuesHistogram, (long) (valueUnitsPerBucket * histogram.getDoubleToIntegerValueConversionRatio()) ); iterationValue = new DoubleHistogramIterationValue(integerLinearIterator.currentIterationValue); }
/** * @param histogram The histogram this iterator will operate on * @param valueUnitsInFirstBucket the size (in value units) of the first value bucket step * @param logBase the multiplier by which the bucket size is expanded in each iteration step. */ public DoubleLogarithmicIterator(final DoubleHistogram histogram, final double valueUnitsInFirstBucket, final double logBase) { this.histogram = histogram; integerLogarithmicIterator = new LogarithmicIterator( histogram.integerValuesHistogram, (long) (valueUnitsInFirstBucket * histogram.getDoubleToIntegerValueConversionRatio()), logBase ); iterationValue = new DoubleHistogramIterationValue(integerLogarithmicIterator.currentIterationValue); }