public class DefaultMonetarySummaryStatistics extends Object implements MonetarySummaryStatistics
MonetarySummaryStatistics This
implementations cannot do exchange rate| Modifier and Type | Field and Description |
|---|---|
protected javax.money.MonetaryAmount |
average |
protected long |
count |
protected javax.money.MonetaryAmount |
max |
protected javax.money.MonetaryAmount |
min |
protected javax.money.MonetaryAmount |
sum |
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultMonetarySummaryStatistics(javax.money.CurrencyUnit currencyUnit)
Creates a new instance, targeting the given
CurrencyUnit. |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(javax.money.MonetaryAmount amount)
Records another value into the summary information.
|
MonetarySummaryStatistics |
combine(MonetarySummaryStatistics summaryStatistics)
Combines the state of another
MonetarySummaryStatistics into this
one. |
boolean |
equals(Object obj) |
javax.money.MonetaryAmount |
getAverage()
Get the mean average of all amounts added.
|
long |
getCount()
Get the number of items added to this summary instance.
|
javax.money.CurrencyUnit |
getCurrencyUnit()
the currency unit used in summary
|
javax.money.MonetaryAmount |
getMax()
Get the maximal amount found within this summary.
|
javax.money.MonetaryAmount |
getMin()
Get the minimal amount found within this summary.
|
javax.money.MonetaryAmount |
getSum()
Get the sum of all amounts within this summary.
|
int |
hashCode() |
boolean |
isExchangeable()
return if is possible do exchange rate or not with the MonetarySummary
|
static DefaultMonetarySummaryStatistics |
of(javax.money.CurrencyUnit currencyUnit)
Creates a new instance, targeting the given
CurrencyUnit. |
MonetarySummaryStatistics |
to(javax.money.CurrencyUnit unit)
created the MonetarySummaryStatistics converted to
CurrencyUnit |
String |
toString() |
protected long count
protected javax.money.MonetaryAmount min
protected javax.money.MonetaryAmount max
protected javax.money.MonetaryAmount sum
protected javax.money.MonetaryAmount average
protected DefaultMonetarySummaryStatistics(javax.money.CurrencyUnit currencyUnit)
CurrencyUnit.currencyUnit - the target currency, not null.public static DefaultMonetarySummaryStatistics of(javax.money.CurrencyUnit currencyUnit)
CurrencyUnit.currencyUnit - the target currency, not null.public void accept(javax.money.MonetaryAmount amount)
MonetarySummaryStatisticsaccept in interface MonetarySummaryStatisticsamount - the input amount value to be added, not null.public javax.money.CurrencyUnit getCurrencyUnit()
MonetarySummaryStatisticsgetCurrencyUnit in interface MonetarySummaryStatisticspublic MonetarySummaryStatistics combine(MonetarySummaryStatistics summaryStatistics)
MonetarySummaryStatisticsMonetarySummaryStatistics into this
one.combine in interface MonetarySummaryStatisticssummaryStatistics - another MonetarySummaryStatistics, not null.public long getCount()
MonetarySummaryStatisticsgetCount in interface MonetarySummaryStatisticspublic javax.money.MonetaryAmount getMin()
MonetarySummaryStatisticsgetMin in interface MonetarySummaryStatisticspublic javax.money.MonetaryAmount getMax()
MonetarySummaryStatisticsgetMax in interface MonetarySummaryStatisticspublic javax.money.MonetaryAmount getSum()
MonetarySummaryStatisticsgetSum in interface MonetarySummaryStatisticspublic javax.money.MonetaryAmount getAverage()
MonetarySummaryStatisticsgetAverage in interface MonetarySummaryStatisticspublic boolean isExchangeable()
MonetarySummaryStatisticsisExchangeable in interface MonetarySummaryStatisticspublic MonetarySummaryStatistics to(javax.money.CurrencyUnit unit)
MonetarySummaryStatisticsCurrencyUnitto in interface MonetarySummaryStatisticsunit - to be convertedCopyright © 2012-2016 JavaMoney. All Rights Reserved.