CurrencyUnit.getFactor()} matches the correct reverse
rate. But in most use cases the reverse rate either has a different rate (not
equal to the reciprocal value), or might not be defined at all. Therefore for
reversing a ExchangeRate one must access an ExchangeRateProvider and
query for the reverse rate.
The class also implements Comparable to allow sorting of multiple
exchange rates using the following sorting order;
Finally ExchangeRate is modeled as an immutable and thread safe type. Also
exchange rates are Serializable, hereby serializing in the following
form and order:
CurrencyUnitCurrencyUnitConversionContextImplementations of this interface
ExchangeRate)| Modifier and Type | Method and Description |
|---|---|
| public CurrencyUnit | |
| public ConversionContext | Returns: the conversion context, never null.Access the |
| public CurrencyUnit | Returns: the termCurrencyUnit.Redeclares javax. CurrencyUnit.
|
| public List | Returns: the chain of rates, in case of a derived rate, this may be several instances. For a direct exchange rate, this equals tonew ExchangeRate[]{this}.Access the chain of exchange rates. |
| public NumberValue | |
| public default boolean | Returns: true, if the exchange rate is derived.Allows to evaluate if this exchange rate is a derived exchange rate. |
| getBaseCurrency | back to summary |
|---|---|
| public CurrencyUnit getBaseCurrency() Get the base (source)
| |
| getContext | back to summary |
|---|---|
| public ConversionContext getContext() Access the
| |
| getCurrency | back to summary |
|---|---|
| public CurrencyUnit getCurrency() Redeclares javax. Get the term (target)
| |
| getExchangeRateChain | back to summary |
|---|---|
| public List Access the chain of exchange rates.
| |
| getFactor | back to summary |
|---|---|
| public NumberValue getFactor() Access the rate's bid factor.
| |
| isDerived | back to summary |
|---|---|
| public default boolean isDerived() Allows to evaluate if this exchange rate is a derived exchange rate. Derived exchange rates are defined by an ordered list of subconversions with intermediate steps, whereas a direct conversion is possible in one steps.
This method always returns
| |