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 |
|---|---|
ExchangeRate |
getExchangeRate(ConversionQuery query) |
ExchangeRate |
getReversed(ExchangeRate rate)
The method reverses the
ExchangeRate to a rate mapping from term
to base CurrencyUnit. |
boolean |
isAvailable(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, multiplygetCurrencyConversion, getCurrencyConversion, getExchangeRate, getExchangeRate, isAvailable, isAvailablepublic IdentityRateProvider()
public boolean isAvailable(ConversionQuery conversionQuery)
isAvailable in interface ExchangeRateProviderisAvailable in class BaseExchangeRateProviderconversionQuery - the required ConversionQuery, not nullpublic ExchangeRate getExchangeRate(ConversionQuery query)
getExchangeRate in interface ExchangeRateProvidergetExchangeRate in class AbstractRateProviderpublic ExchangeRate getReversed(ExchangeRate rate)
BaseExchangeRateProviderExchangeRate 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 ExchangeRateProvidergetReversed in class BaseExchangeRateProviderExchangeRate, or null, if
the rate cannot be reversed.Copyright © 2012–2020 JavaMoney. All rights reserved.