Class ImmutableQuantityHistogram


  • public class ImmutableQuantityHistogram
    extends Object
    This is an adapter to present a histogram of plain numeric types as a histogram whose type is a Quantity.
    • Method Detail

      • of

        public static <N extends Number,​Q extends Quantity<Q>> ImmutableHistogram<Quantity<Q>> of​(Histogram<N> histogram,
                                                                                                        Unit<Q> baseUnit,
                                                                                                        QuantityFactory<Q> quantityFactory)
        Make a copy of a histogram, transforming its upper bound values into instances of Quantity with the specified measurement and unit.
        Type Parameters:
        N - The numeric value type of the input histogram.
        Q - The Quantity value type of the desired histogram.
        Parameters:
        histogram - The histogram of plain Number values.
        baseUnit - The unit that the upper bound values in the histogram should represent. Example: if the histogram contains Long values representing milliseconds, this argument should represent one millisecond.
        quantityFactory - An object that can instantiate objects of type Quantity<Q>.
        Returns:
        A copy of the input histogram, transformed so its upper bound values are represented as Quantity values of measure type Q.