Class QuantitySummaryStatistics<Q extends Quantity<Q>>

    • Method Detail

      • accept

        public void accept​(Quantity<Q> quantity)
        Records another value into the summary information.
        Parameters:
        quantity - the input quantity value to be added, not null.
      • getCount

        public long getCount()
        Get the number of items added to this summary instance.
        Returns:
        the number of summarized items, >= 0.
      • getMin

        public Quantity<QgetMin()
        Get the minimal quantity found within this summary.
        Returns:
        the minimal quantity
      • getMin

        public Quantity<QgetMin​(Unit<Q> unit)
        Get the minimal quantity found within this summary converted to unit
        Parameters:
        unit - to convert
        Returns:
        the minimal quantity converted to this unit
      • getMax

        public Quantity<QgetMax()
        Get the maximal amount found within this summary.
        Returns:
        the maximal quantity
      • getMax

        public Quantity<QgetMax​(Unit<Q> unit)
        Get the maximal amount found within this summary converted to unit
        Parameters:
        unit - to convert
        Returns:
        the maximal quantity converted to this unit
      • getSum

        public Quantity<QgetSum()
        Get the sum of all amounts within this summary.
        Returns:
        the total amount
      • getSum

        public Quantity<QgetSum​(Unit<Q> unit)
        Get the sum of all amounts within this summary converted to unit
        Parameters:
        unit - to convert
        Returns:
        the total amount converted to this unit
      • getAverage

        public Quantity<QgetAverage()
        Get the quantity average of all amounts added.
        Returns:
        the quantity average quantity
      • getAverage

        public Quantity<QgetAverage​(Unit<Q> unit)
        Get the quantity average of all amounts added converted to unit
        Parameters:
        unit - to convert
        Returns:
        the average quantity converted to this unit
      • to

        public QuantitySummaryStatistics<Qto​(Unit<Q> unit)
        convert the summary to this unit measure
        Parameters:
        unit - to convert the summary
        Returns:
        the summary converted to this unit
      • equals

        public boolean equals​(Object obj)
        will equals when the unit were equals
        Overrides:
        equals in class Object