Package tech.units.indriya.function
Class QuantitySummaryStatistics<Q extends Quantity<Q>>
- java.lang.Object
-
- tech.units.indriya.function.QuantitySummaryStatistics<Q>
-
- Type Parameters:
Q-
public class QuantitySummaryStatistics<Q extends Quantity<Q>> extends Object
- Since:
- 1.0
- Version:
- 1.2
- Author:
- Otavio, Werner
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Quantity<Q> quantity)Records another value into the summary information.QuantitySummaryStatistics<Q>combine(QuantitySummaryStatistics<Q> quantitySummary)Combines the state of anotherQuantitySummaryStatisticsinto this one.booleanequals(Object obj)will equals when the unit were equalsQuantity<Q>getAverage()Get the quantity average of all amounts added.Quantity<Q>getAverage(Unit<Q> unit)Get the quantity average of all amounts added converted to unitlonggetCount()Get the number of items added to this summary instance.Quantity<Q>getMax()Get the maximal amount found within this summary.Quantity<Q>getMax(Unit<Q> unit)Get the maximal amount found within this summary converted to unitQuantity<Q>getMin()Get the minimal quantity found within this summary.Quantity<Q>getMin(Unit<Q> unit)Get the minimal quantity found within this summary converted to unitQuantity<Q>getSum()Get the sum of all amounts within this summary.Quantity<Q>getSum(Unit<Q> unit)Get the sum of all amounts within this summary converted to unitinthashCode()QuantitySummaryStatistics<Q>to(Unit<Q> unit)convert the summary to this unit measureStringtoString()
-
-
-
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.
-
combine
public QuantitySummaryStatistics<Q> combine(QuantitySummaryStatistics<Q> quantitySummary)
Combines the state of anotherQuantitySummaryStatisticsinto this one.- Parameters:
quantitySummary- anotherQuantitySummaryStatistics, 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<Q> getMin()
Get the minimal quantity found within this summary.- Returns:
- the minimal quantity
-
getMin
public Quantity<Q> getMin(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<Q> getMax()
Get the maximal amount found within this summary.- Returns:
- the maximal quantity
-
getMax
public Quantity<Q> getMax(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<Q> getSum()
Get the sum of all amounts within this summary.- Returns:
- the total amount
-
getSum
public Quantity<Q> getSum(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<Q> getAverage()
Get the quantity average of all amounts added.- Returns:
- the quantity average quantity
-
getAverage
public Quantity<Q> getAverage(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<Q> to(Unit<Q> unit)
convert the summary to this unit measure- Parameters:
unit- to convert the summary- Returns:
- the summary converted to this unit
-
-