public final class RoundingQuery extends AbstractQuery implements CurrencySupplier
MonetaryRounding
. In general it is determined by the
implementation, what roundings are provided. Nevertheless the following queries must be supported:
MathContext
as
additional generic attribute.CurrencyUnit
. This method should return the most
appropriate rounding for a currency. If no
currency specific rounding is available, it should return a rounding with scale==currency
.getDefaultFractionUnits(), java.math.RoundingMode = RoundingMode.HALF_EVEN
.This class is immutable, thread-safe and serializable.
KEY_QUERY_PROVIDERS, KEY_QUERY_TARGET_TYPE, KEY_QUERY_TIMESTAMP
KEY_PROVIDER
Modifier and Type | Method and Description |
---|---|
CurrencyUnit |
getCurrency()
Sets the target CurrencyUnit.
|
String |
getRoundingName()
Gets the target rounding name.
|
Integer |
getScale()
Gets the target scale.
|
RoundingQueryBuilder |
toBuilder()
Creates a new builder instances, initialized with the data from this one.
|
getProviderNames, getTargetType
public String getRoundingName()
MonetaryRounding
instances by passing a name, which most of the time
identifies a certain rounding instance. Each entry is first matched as name on equality. If no instance
with such a name exists, the value passed is interpreted as a regular
expression to lookup roundings.public Integer getScale()
public CurrencyUnit getCurrency()
getCurrency
in interface CurrencySupplier
public RoundingQueryBuilder toBuilder()
RoundingQueryBuilder
instance, never null.Copyright © 2012–2016 JSR 354 - Expert Group. All rights reserved.