Top Fields Constructors Methods
tech.units.indriya.function

public Class QuantitySummaryStatistics<Q extends Quantity<Q>>

extends Object
Class Inheritance
Static Imports
tech.uom.lib.common.function.QuantityFunctions.*

Authors
Otavio, Werner
Since
1.0
Version
1.2

Field Summary

Modifier and TypeField and Description
private Quantity<Q>
private long
private final Quantity<Q>
private Quantity<Q>
private final BinaryOperator<Quantity<Q>>
private Quantity<Q>
private final BinaryOperator<Quantity<Q>>
private Quantity<Q>

Constructor Summary

AccessConstructor and Description
pack-priv
QuantitySummaryStatistics(Unit<Q>
the target unit, not null.
unit
)

Creates a new instance, targeting the given javax.measure.Unit.

Method Summary

Modifier and TypeMethod and Description
public void
accept(Quantity<Q>
the input quantity value to be added, not null.
quantity
)

Records another value into the summary information.

public QuantitySummaryStatistics<Q>
combine(QuantitySummaryStatistics<Q>
another QuantitySummaryStatistics, not null.
quantitySummary
)

Combines the state of another QuantitySummaryStatistics into this one.

private void
doSummary(Quantity<Q> moneraty)

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

will equals when the unit were equals

public Quantity<Q>

Returns:

the quantity average quantity
getAverage
()

Get the quantity average of all amounts added.

public Quantity<Q>

Returns:

the average quantity converted to this unit
getAverage
(Unit<Q>
to convert
unit
)

Get the quantity average of all amounts added converted to unit

public long

Returns:

the number of summarized items, >= 0.
getCount
()

Get the number of items added to this summary instance.

public Quantity<Q>

Returns:

the maximal quantity
getMax
()

Get the maximal amount found within this summary.

public Quantity<Q>

Returns:

the maximal quantity converted to this unit
getMax
(Unit<Q>
to convert
unit
)

Get the maximal amount found within this summary converted to unit

public Quantity<Q>

Returns:

the minimal quantity
getMin
()

Get the minimal quantity found within this summary.

public Quantity<Q>

Returns:

the minimal quantity converted to this unit
getMin
(Unit<Q>
to convert
unit
)

Get the minimal quantity found within this summary converted to unit

public Quantity<Q>

Returns:

the total amount
getSum
()

Get the sum of all amounts within this summary.

public Quantity<Q>

Returns:

the total amount converted to this unit
getSum
(Unit<Q>
to convert
unit
)

Get the sum of all amounts within this summary converted to unit

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private boolean
private void
setQuantity(Quantity<Q> quantity)

public QuantitySummaryStatistics<Q>

Returns:

the summary converted to this unit
to
(Unit<Q>
to convert the summary
unit
)

convert the summary to this unit measure

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

averageback to summary
private Quantity<Q> average
countback to summary
private long count
emptyback to summary
private final Quantity<Q> empty
maxback to summary
private Quantity<Q> max
maxFunctionsback to summary
private final BinaryOperator<Quantity<Q>> maxFunctions
minback to summary
private Quantity<Q> min
minFunctionsback to summary
private final BinaryOperator<Quantity<Q>> minFunctions
sumback to summary
private Quantity<Q> sum

Constructor Detail

QuantitySummaryStatisticsback to summary
pack-priv QuantitySummaryStatistics(Unit<Q> unit)

Creates a new instance, targeting the given javax.measure.Unit.

Parameters
unit:Unit<Q>

the target unit, not null.

Method Detail

acceptback to summary
public void accept(Quantity<Q> quantity)

Records another value into the summary information.

Parameters
quantity:Quantity<Q>

the input quantity value to be added, not null.

combineback to summary
public QuantitySummaryStatistics<Q> combine(QuantitySummaryStatistics<Q> quantitySummary)

Combines the state of another QuantitySummaryStatistics into this one.

Parameters
quantitySummary:QuantitySummaryStatistics<Q>

another QuantitySummaryStatistics, not null.

doSummaryback to summary
private void doSummary(Quantity<Q> moneraty)
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

will equals when the unit were equals

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAverageback to summary
public Quantity<Q> getAverage()

Get the quantity average of all amounts added.

Returns:Quantity<Q>

the quantity average quantity

getAverageback to summary
public Quantity<Q> getAverage(Unit<Q> unit)

Get the quantity average of all amounts added converted to unit

Parameters
unit:Unit<Q>

to convert

Returns:Quantity<Q>

the average quantity converted to this unit

getCountback to summary
public long getCount()

Get the number of items added to this summary instance.

Returns:long

the number of summarized items, >= 0.

getMaxback to summary
public Quantity<Q> getMax()

Get the maximal amount found within this summary.

Returns:Quantity<Q>

the maximal quantity

getMaxback to summary
public Quantity<Q> getMax(Unit<Q> unit)

Get the maximal amount found within this summary converted to unit

Parameters
unit:Unit<Q>

to convert

Returns:Quantity<Q>

the maximal quantity converted to this unit

getMinback to summary
public Quantity<Q> getMin()

Get the minimal quantity found within this summary.

Returns:Quantity<Q>

the minimal quantity

getMinback to summary
public Quantity<Q> getMin(Unit<Q> unit)

Get the minimal quantity found within this summary converted to unit

Parameters
unit:Unit<Q>

to convert

Returns:Quantity<Q>

the minimal quantity converted to this unit

getSumback to summary
public Quantity<Q> getSum()

Get the sum of all amounts within this summary.

Returns:Quantity<Q>

the total amount

getSumback to summary
public Quantity<Q> getSum(Unit<Q> unit)

Get the sum of all amounts within this summary converted to unit

Parameters
unit:Unit<Q>

to convert

Returns:Quantity<Q>

the total amount converted to this unit

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
isEmptyback to summary
private boolean isEmpty()
setQuantityback to summary
private void setQuantity(Quantity<Q> quantity)
toback to summary
public QuantitySummaryStatistics<Q> to(Unit<Q> unit)

convert the summary to this unit measure

Parameters
unit:Unit<Q>

to convert the summary

Returns:QuantitySummaryStatistics<Q>

the summary converted to this unit

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override