javax.money.MonetaryOperator
instances for CurrencyUnit instances. modeling rounding based on
minimal minor units available for cash payments.
This class is thread safe.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | CASHROUNDING_KEY
The cash rounding flag key to be used. |
| private RoundingContext | |
| private static final String | MINMINORS_KEY
The scale key to be used. |
| 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 | DefaultCashRounding(int
The target scale. scale, RoundingMode The roundingMode, int minimalMinors)RoundingMode to be used, not null.Creates an rounding instance. |
| pack-priv | DefaultCashRounding(CurrencyUnit
The currency, which determines the required precision. As
currency, RoundingMode roundingMode, int minimalMinors)RoundingMode, by default, RoundingMode#HALF_UP
is used.Creates an |
| pack-priv | DefaultCashRounding(CurrencyUnit
The currency, which determines the required precision. As
currency, int minimalMinors)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
|
| CASHROUNDING_KEY | back to summary |
|---|---|
| private static final String CASHROUNDING_KEY The cash rounding flag key to be used. | |
| context | back to summary |
|---|---|
| private RoundingContext context | |
| MINMINORS_KEY | back to summary |
|---|---|
| private static final String MINMINORS_KEY The scale key to be used. | |
| 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 | |
| DefaultCashRounding | back to summary |
|---|---|
| pack-priv DefaultCashRounding(int scale, RoundingMode roundingMode, int minimalMinors) Creates an rounding instance.
| |
| DefaultCashRounding | back to summary |
|---|---|
| pack-priv DefaultCashRounding(CurrencyUnit currency, RoundingMode roundingMode, int minimalMinors) Creates an
| |
| DefaultCashRounding | back to summary |
|---|---|
| pack-priv DefaultCashRounding(CurrencyUnit currency, int minimalMinors) 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
| |