Package tech.units.indriya.function
Class QuantitySummaryStatistics<Q extends javax.measure.Quantity<Q>>
java.lang.Object
tech.units.indriya.function.QuantitySummaryStatistics<Q>
- Type Parameters:
Q
-
- Since:
- 1.0
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javax.measure.Quantity<Q>
private long
private final javax.measure.Quantity<Q>
private javax.measure.Quantity<Q>
private final BinaryOperator<javax.measure.Quantity<Q>>
private javax.measure.Quantity<Q>
private final BinaryOperator<javax.measure.Quantity<Q>>
private javax.measure.Quantity<Q>
-
Constructor Summary
ConstructorsConstructorDescriptionQuantitySummaryStatistics
(javax.measure.Unit<Q> unit) Creates a new instance, targeting the givenUnit
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Records another value into the summary information.combine
(QuantitySummaryStatistics<Q> quantitySummary) Combines the state of anotherQuantitySummaryStatistics
into this one.private void
boolean
will equals when the unit were equalsjavax.measure.Quantity<Q>
Get the quantity average of all amounts added.javax.measure.Quantity<Q>
getAverage
(javax.measure.Unit<Q> unit) Get the quantity average of all amounts added converted to unitlong
getCount()
Get the number of items added to this summary instance.javax.measure.Quantity<Q>
getMax()
Get the maximal amount found within this summary.javax.measure.Quantity<Q>
Get the maximal amount found within this summary converted to unitjavax.measure.Quantity<Q>
getMin()
Get the minimal quantity found within this summary.javax.measure.Quantity<Q>
Get the minimal quantity found within this summary converted to unitjavax.measure.Quantity<Q>
getSum()
Get the sum of all amounts within this summary.javax.measure.Quantity<Q>
Get the sum of all amounts within this summary converted to unitint
hashCode()
private boolean
isEmpty()
private void
setQuantity
(javax.measure.Quantity<Q> quantity) convert the summary to this unit measuretoString()
-
Field Details
-
empty
-
count
private long count -
min
-
max
-
sum
-
average
-
minFunctions
private final BinaryOperator<javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>> minFunctions -
maxFunctions
private final BinaryOperator<javax.measure.Quantity<Q extends javax.measure.Quantity<Q>>> maxFunctions
-
-
Constructor Details
-
QuantitySummaryStatistics
QuantitySummaryStatistics(javax.measure.Unit<Q> unit) Creates a new instance, targeting the givenUnit
.- Parameters:
unit
- the target unit, not null.
-
-
Method Details
-
accept
Records another value into the summary information.- Parameters:
quantity
- the input quantity value to be added, not null.
-
combine
Combines the state of anotherQuantitySummaryStatistics
into this one.- Parameters:
quantitySummary
- anotherQuantitySummaryStatistics
, not null.
-
doSummary
-
isEmpty
private boolean isEmpty() -
setQuantity
-
getCount
public long getCount()Get the number of items added to this summary instance.- Returns:
- the number of summarized items, >= 0.
-
getMin
Get the minimal quantity found within this summary.- Returns:
- the minimal quantity
-
getMin
Get the minimal quantity found within this summary converted to unit- Parameters:
unit
- to convert- Returns:
- the minimal quantity converted to this unit
-
getMax
Get the maximal amount found within this summary.- Returns:
- the maximal quantity
-
getMax
Get the maximal amount found within this summary converted to unit- Parameters:
unit
- to convert- Returns:
- the maximal quantity converted to this unit
-
getSum
Get the sum of all amounts within this summary.- Returns:
- the total amount
-
getSum
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
Get the quantity average of all amounts added.- Returns:
- the quantity average quantity
-
getAverage
Get the quantity average of all amounts added converted to unit- Parameters:
unit
- to convert- Returns:
- the average quantity converted to this unit
-
to
convert the summary to this unit measure- Parameters:
unit
- to convert the summary- Returns:
- the summary converted to this unit
-
equals
will equals when the unit were equals -
hashCode
public int hashCode() -
toString
-