javax.money.MonetaryOperator instances
for CurrencyUnit instances. modeling rounding based on standard JDK
math, a scale and RoundingMode.
This class is thread safe.
RoundingMode
| Modifier and Type | Field and Description |
|---|---|
| private final RoundingContext | context
The |
| private static final String | PROVCLASS_KEY
The provider class key to be used. |
| private static final String | SCALE_KEY
The scale key to be used. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | DefaultRounding(int scale, RoundingMode
The roundingMode)java. to be used, not null.Creates an rounding instance. |
| pack-priv | DefaultRounding(CurrencyUnit
The currency, which determines the required precision. As
currency, RoundingMode roundingMode)RoundingMode, by default, RoundingMode#HALF_UP
is used.Creates an |
| Modifier and Type | Method and Description |
|---|---|
| public MonetaryAmount | apply(MonetaryAmount amount)
Implements javax. Applies the operator on the given amount. |
| public RoundingContext | getRoundingContext()
Implements javax. Access the rounding's context, which gives more details of the rounding instances such as
|
| context | back to summary |
|---|---|
| private final RoundingContext context The | |
| PROVCLASS_KEY | back to summary |
|---|---|
| private static final String PROVCLASS_KEY The provider class key to be used. | |
| SCALE_KEY | back to summary |
|---|---|
| private static final String SCALE_KEY The scale key to be used. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| DefaultRounding | back to summary |
|---|---|
| pack-priv DefaultRounding(int scale, RoundingMode roundingMode) Creates an rounding instance.
| |
| DefaultRounding | back to summary |
|---|---|
| pack-priv DefaultRounding(CurrencyUnit currency, RoundingMode roundingMode) Creates an
| |
| apply | back to summary |
|---|---|
| public MonetaryAmount apply(MonetaryAmount amount) Implements javax. Doc from javax. Applies the operator on the given amount.
| |
| getRoundingContext | back to summary |
|---|---|
| public RoundingContext getRoundingContext() Implements javax. Doc from javax. Access the rounding's context, which gives more details of the rounding instances such as
| |