Package org.bitcoinj.utils
Class ExchangeRate
java.lang.Object
org.bitcoinj.utils.ExchangeRate
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExchangeRate
(Coin coin, Fiat fiat) Construct exchange rate.ExchangeRate
(Fiat fiat) Construct exchange rate. -
Method Summary
Modifier and TypeMethodDescriptioncoinToFiat
(Coin convertCoin) Convert a coin amount to a fiat amount using this exchange rate.boolean
fiatToCoin
(Fiat convertFiat) Convert a fiat amount to a coin amount using this exchange rate.int
hashCode()
-
Field Details
-
coin
-
fiat
-
-
Constructor Details
-
ExchangeRate
Construct exchange rate. This amount of coin is worth that amount of fiat. -
ExchangeRate
Construct exchange rate. One coin is worth this amount of fiat.
-
-
Method Details
-
coinToFiat
Convert a coin amount to a fiat amount using this exchange rate.- Throws:
ArithmeticException
- if the converted fiat amount is too high or too low.
-
fiatToCoin
Convert a fiat amount to a coin amount using this exchange rate.- Throws:
ArithmeticException
- if the converted coin amount is too high or too low.
-
equals
-
hashCode
public int hashCode()
-