Top Description Methods
org.javamoney.moneta.function

public Interface MonetarySummaryStatistics

Known Direct Implementers
org.javamoney.moneta.function.DefaultMonetarySummaryStatistics
Imports
javax.money.CurrencyUnit, .MonetaryAmount

A state object for collecting statistics such as count, min, max, sum, and average.
Authors
otaviojava, Anatole Tresch

Method Summary

Modifier and TypeMethod and Description
public void
accept(MonetaryAmount
the input amount value to be added, not null.
amount
)

Records another value into the summary information.

public MonetarySummaryStatistics
combine(MonetarySummaryStatistics
another MonetarySummaryStatistics, not null.
summaryStatistics
)

Combines the state of another MonetarySummaryStatistics into this one.

public MonetaryAmount

Returns:

the mean average amount, or null if no amount was added to this summary instance.
getAverage
()

Get the mean average of all amounts added.

public long

Returns:

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

Get the number of items added to this summary instance.

public CurrencyUnit

Returns:

the currency unit
getCurrencyUnit
()

the currency unit used in summary

public MonetaryAmount

Returns:

the minimal amount, or null if no amount was added to this summary instance.
getMax
()

Get the maximal amount found within this summary.

public MonetaryAmount

Returns:

the minimal amount, or null if no amount was added to this summary instance.
getMin
()

Get the minimal amount found within this summary.

public MonetaryAmount

Returns:

the total amount, or null if no amount was added to this summary instance.
getSum
()

Get the sum of all amounts within this summary.

public boolean

Returns:

false;
isExchangeable
()

return if is possible do exchange rate or not with the MonetarySummary

public MonetarySummaryStatistics

Returns:

MonetarySummaryStatistics converted
to
(CurrencyUnit
to be converted
unit
)

created the MonetarySummaryStatistics converted to CurrencyUnit

Method Detail

acceptback to summary
public void accept(MonetaryAmount amount)

Records another value into the summary information.

Parameters
amount:MonetaryAmount

the input amount value to be added, not null.

combineback to summary
public MonetarySummaryStatistics combine(MonetarySummaryStatistics summaryStatistics)

Combines the state of another MonetarySummaryStatistics into this one.

Parameters
summaryStatistics:MonetarySummaryStatistics

another MonetarySummaryStatistics, not null.

getAverageback to summary
public MonetaryAmount getAverage()

Get the mean average of all amounts added.

Returns:MonetaryAmount

the mean average amount, or null if no amount was added to this summary instance.

getCountback to summary
public long getCount()

Get the number of items added to this summary instance.

Returns:long

the number of summarized items, >= 0.

getCurrencyUnitback to summary
public CurrencyUnit getCurrencyUnit()

the currency unit used in summary

Returns:CurrencyUnit

the currency unit

getMaxback to summary
public MonetaryAmount getMax()

Get the maximal amount found within this summary.

Returns:MonetaryAmount

the minimal amount, or null if no amount was added to this summary instance.

getMinback to summary
public MonetaryAmount getMin()

Get the minimal amount found within this summary.

Returns:MonetaryAmount

the minimal amount, or null if no amount was added to this summary instance.

getSumback to summary
public MonetaryAmount getSum()

Get the sum of all amounts within this summary.

Returns:MonetaryAmount

the total amount, or null if no amount was added to this summary instance.

isExchangeableback to summary
public boolean isExchangeable()

return if is possible do exchange rate or not with the MonetarySummary

Returns:boolean

false;

toback to summary
public MonetarySummaryStatistics to(CurrencyUnit unit)

created the MonetarySummaryStatistics converted to CurrencyUnit

Parameters
unit:CurrencyUnit

to be converted

Returns:MonetarySummaryStatistics

MonetarySummaryStatistics converted

Exceptions
UnsupportedOperationException:
if MonetarySummaryStatistics#isExchangeable() was false
NullPointerException:
if unit was null