Module java.money
Package javax.money
Class DefaultMonetaryRoundingsSingletonSpi.DefaultCurrencyRounding
- java.lang.Object
-
- javax.money.DefaultMonetaryRoundingsSingletonSpi.DefaultCurrencyRounding
-
- All Implemented Interfaces:
java.io.Serializable,MonetaryOperator,MonetaryRounding
- Enclosing class:
- DefaultMonetaryRoundingsSingletonSpi
private static final class DefaultMonetaryRoundingsSingletonSpi.DefaultCurrencyRounding extends java.lang.Object implements MonetaryRounding, java.io.Serializable
Default Rounding that rounds aMonetaryAmountbased on the amount'sCurrencyUnit.
-
-
Field Summary
Fields Modifier and Type Field Description private static RoundingContextROUNDING_CONTEXTprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description privateDefaultCurrencyRounding()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MonetaryAmountapply(MonetaryAmount amount)Applies the operator on the given amount.RoundingContextgetRoundingContext()Access the rounding's context, which gives more details of the rounding instances such as The rounding's name (required) Its provider (required) Its base currency its scale and rounding mode any other attributes useful to describe the rounding
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ROUNDING_CONTEXT
private static final RoundingContext ROUNDING_CONTEXT
-
-
Method Detail
-
apply
public MonetaryAmount apply(MonetaryAmount amount)
Description copied from interface:MonetaryOperatorApplies the operator on the given amount.- Specified by:
applyin interfaceMonetaryOperator- Parameters:
amount- the amount to be operated on.- Returns:
- the applied amount.
-
getRoundingContext
public RoundingContext getRoundingContext()
Description copied from interface:MonetaryRoundingAccess the rounding's context, which gives more details of the rounding instances such as- The rounding's name (required)
- Its provider (required)
- Its base currency
- its scale and rounding mode
- any other attributes useful to describe the rounding
- Specified by:
getRoundingContextin interfaceMonetaryRounding- Returns:
- the rounding's context, never null.
-
-