Package org.bitcoinj.utils
Class ExchangeRate
- java.lang.Object
-
- org.bitcoinj.utils.ExchangeRate
-
public class ExchangeRate extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ExchangeRate(Coin coin, Fiat fiat)Construct exchange rate.ExchangeRate(Fiat fiat)Construct exchange rate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FiatcoinToFiat(Coin convertCoin)Convert a coin amount to a fiat amount using this exchange rate.booleanequals(java.lang.Object o)CoinfiatToCoin(Fiat convertFiat)Convert a fiat amount to a coin amount using this exchange rate.inthashCode()
-
-
-
Method Detail
-
coinToFiat
public Fiat coinToFiat(Coin convertCoin)
Convert a coin amount to a fiat amount using this exchange rate.- Throws:
java.lang.ArithmeticException- if the converted fiat amount is too high or too low.
-
fiatToCoin
public Coin fiatToCoin(Fiat convertFiat)
Convert a fiat amount to a coin amount using this exchange rate.- Throws:
java.lang.ArithmeticException- if the converted coin amount is too high or too low.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-