public abstract class BaseMonetaryRoundingsSingletonSpi extends Object implements MonetaryRoundingsSingletonSpi
MonetaryOperator.
This class is thread-safe.| Constructor and Description |
|---|
BaseMonetaryRoundingsSingletonSpi() |
| Modifier and Type | Method and Description |
|---|---|
MonetaryRounding |
getRounding(CurrencyUnit currencyUnit,
String... providers)
Access a
MonetaryRounding for rounding MonetaryAmount
instances given a currency. |
MonetaryRounding |
getRounding(RoundingQuery query)
Query a specific rounding with the given query.
|
MonetaryRounding |
getRounding(String roundingName,
String... providers)
Access a
MonetaryRounding using the rounding name. |
boolean |
isRoundingAvailable(CurrencyUnit currencyUnit,
String... providers)
Checks if a
MonetaryRounding is available given a CurrencyUnit. |
boolean |
isRoundingAvailable(RoundingQuery query)
Checks if any
MonetaryRounding is matching the given query. |
boolean |
isRoundingAvailable(String roundingId,
String... providers)
Checks if a
MonetaryRounding is available given a roundingId. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefaultProviderChain, getDefaultRounding, getProviderNames, getRoundingNames, getRoundingspublic BaseMonetaryRoundingsSingletonSpi()
public MonetaryRounding getRounding(CurrencyUnit currencyUnit, String... providers)
MonetaryRounding for rounding MonetaryAmount
instances given a currency.getRounding in interface MonetaryRoundingsSingletonSpicurrencyUnit - The currency, which determines the required precision. As
RoundingMode, by default, RoundingMode.HALF_UP
is sued.providers - the optional provider list and ordering to be usedMonetaryOperator implementing the
rounding, never null.MonetaryException - if no such rounding could be provided.public MonetaryRounding getRounding(String roundingName, String... providers)
MonetaryRounding using the rounding name.getRounding in interface MonetaryRoundingsSingletonSpiroundingName - The rounding name, not null.providers - the optional provider list and ordering to be usedMonetaryOperator implementing the
rounding, never null.IllegalArgumentException - if no such rounding is registered using a
RoundingProviderSpi instance.public MonetaryRounding getRounding(RoundingQuery query)
AbstractQuery.getProviderNames().getRounding in interface MonetaryRoundingsSingletonSpiquery - the rounding query, not null.public boolean isRoundingAvailable(RoundingQuery query)
MonetaryRounding is matching the given query.isRoundingAvailable in interface MonetaryRoundingsSingletonSpiquery - the rounding query, not null.public boolean isRoundingAvailable(String roundingId, String... providers)
MonetaryRounding is available given a roundingId.isRoundingAvailable in interface MonetaryRoundingsSingletonSpiroundingId - The rounding identifier.providers - the providers and ordering to be used. By default providers and ordering as defined in
#getDefaultProviders is used.MonetaryRounding is available.IllegalArgumentException - if no such rounding is registered using a
RoundingProviderSpi instance.public boolean isRoundingAvailable(CurrencyUnit currencyUnit, String... providers)
MonetaryRounding is available given a CurrencyUnit.isRoundingAvailable in interface MonetaryRoundingsSingletonSpicurrencyUnit - The currency, which determines the required precision. As RoundingMode,
by default, RoundingMode.HALF_UP is used.providers - the providers and ordering to be used. By default providers and ordering as defined in
#getDefaultProviders is used.MonetaryRounding is available.IllegalArgumentException - if no such rounding is registered using a
RoundingProviderSpi instance.Copyright © 2012–2020 JavaMoney. All rights reserved.