public class IdentityRateProvider extends AbstractRateProvider
ExchangeRateProvider
that provides exchange rate with factor
one for identical base/term currencies.LOGGER
Constructor and Description |
---|
IdentityRateProvider()
Constructor, also loads initial data.
|
Modifier and Type | Method and Description |
---|---|
javax.money.convert.ExchangeRate |
getExchangeRate(javax.money.convert.ConversionQuery query) |
javax.money.convert.ExchangeRate |
getReversed(javax.money.convert.ExchangeRate rate)
The method reverses the
ExchangeRate to a rate mapping from term
to base CurrencyUnit . |
boolean |
isAvailable(javax.money.convert.ConversionQuery conversionQuery)
Check if this provider can provide a rate, which is only the case if base and term are equal.
|
divide, divide, formatLocalDate, getContext, getCurrencyConversion, multiply
getCurrencyConversion, getCurrencyConversion, getExchangeRate, getExchangeRate, isAvailable, isAvailable
public IdentityRateProvider()
public boolean isAvailable(javax.money.convert.ConversionQuery conversionQuery)
isAvailable
in interface javax.money.convert.ExchangeRateProvider
isAvailable
in class BaseExchangeRateProvider
conversionQuery
- the required ConversionQuery
, not null
public javax.money.convert.ExchangeRate getExchangeRate(javax.money.convert.ConversionQuery query)
getExchangeRate
in interface javax.money.convert.ExchangeRateProvider
getExchangeRate
in class AbstractRateProvider
public javax.money.convert.ExchangeRate getReversed(javax.money.convert.ExchangeRate rate)
BaseExchangeRateProvider
ExchangeRate
to a rate mapping from term
to base CurrencyUnit
. Hereby the factor must not be
recalculated as 1/oldFactor
, since typically reverse rates are
not symmetric in most cases.getReversed
in interface javax.money.convert.ExchangeRateProvider
getReversed
in class BaseExchangeRateProvider
ExchangeRate
, or null
, if
the rate cannot be reversed.Copyright © 2012-2015 JavaMoney. All Rights Reserved.