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 Fiat
coinToFiat(Coin convertCoin)
Convert a coin amount to a fiat amount using this exchange rate.boolean
equals(java.lang.Object o)
Coin
fiatToCoin(Fiat convertFiat)
Convert a fiat amount to a coin amount using this exchange rate.int
hashCode()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-