Package yahoofinance.quotes.fx
Class FxQuote
- java.lang.Object
-
- yahoofinance.quotes.fx.FxQuote
-
public class FxQuote extends java.lang.Object- Author:
- Stijn Strickx
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigDecimalgetPrice()Returns the requested FX rate.java.math.BigDecimalgetPrice(boolean refresh)Returns the requested FX rate.java.lang.StringgetSymbol()voidsetPrice(java.math.BigDecimal price)voidsetSymbol(java.lang.String symbol)java.lang.StringtoString()
-
-
-
Method Detail
-
getSymbol
public java.lang.String getSymbol()
-
setSymbol
public void setSymbol(java.lang.String symbol)
-
getPrice
public java.math.BigDecimal getPrice()
Returns the requested FX rate.- Returns:
- the requested FX rate
-
getPrice
public java.math.BigDecimal getPrice(boolean refresh) throws java.io.IOExceptionReturns the requested FX rate. This method will return 0 in the following situations:- the data hasn't been loaded yet in a previous request and refresh is set to false.
- refresh is true and the data cannot be retrieved from Yahoo Finance for whatever reason (symbol not recognized, no network connection, ...)
- Parameters:
refresh- indicates whether the data should be requested again to Yahoo Finance- Returns:
- the requested FX rate
- Throws:
java.io.IOException- when there's a connection problem
-
setPrice
public void setPrice(java.math.BigDecimal price)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-