public class Stock
extends java.lang.Object
| Constructor and Description |
|---|
Stock(java.lang.String symbol) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCurrency() |
StockDividend |
getDividend()
Returns the dividend data available for this stock.
|
StockDividend |
getDividend(boolean refresh)
Returns the dividend data available for this stock.
|
java.util.List<HistoricalQuote> |
getHistory()
This method will return historical quotes from this stock.
|
java.util.List<HistoricalQuote> |
getHistory(java.util.Calendar from)
Requests the historical quotes for this stock with the following characteristics.
|
java.util.List<HistoricalQuote> |
getHistory(java.util.Calendar from,
java.util.Calendar to)
Requests the historical quotes for this stock with the following characteristics.
|
java.util.List<HistoricalQuote> |
getHistory(java.util.Calendar from,
java.util.Calendar to,
Interval interval)
Requests the historical quotes for this stock with the following characteristics.
|
java.util.List<HistoricalQuote> |
getHistory(java.util.Calendar from,
Interval interval)
Requests the historical quotes for this stock with the following characteristics.
|
java.util.List<HistoricalQuote> |
getHistory(Interval interval)
Requests the historical quotes for this stock with the following characteristics.
|
java.lang.String |
getName() |
StockQuote |
getQuote()
Returns the basic quotes data available for this stock.
|
StockQuote |
getQuote(boolean refresh)
Returns the basic quotes data available for this stock.
|
StockStats |
getStats()
Returns the statistics available for this stock.
|
StockStats |
getStats(boolean refresh)
Returns the statistics available for this stock.
|
java.lang.String |
getStockExchange() |
java.lang.String |
getSymbol() |
void |
print() |
void |
setCurrency(java.lang.String currency) |
void |
setDividend(StockDividend dividend) |
void |
setHistory(java.util.List<HistoricalQuote> history) |
void |
setName(java.lang.String name) |
void |
setQuote(StockQuote quote) |
void |
setStats(StockStats stats) |
void |
setStockExchange(java.lang.String stockExchange) |
java.lang.String |
toString() |
public StockQuote getQuote()
getQuote(boolean)public StockQuote getQuote(boolean refresh)
When the quote data gets refreshed, it will automatically also refresh the statistics and dividend data of the stock from Yahoo Finance in the same request.
refresh - indicates whether the data should be requested again to Yahoo Financepublic void setQuote(StockQuote quote)
public StockStats getStats()
getStats(boolean)public StockStats getStats(boolean refresh)
When the statistics get refreshed, it will automatically also refresh the quote and dividend data of the stock from Yahoo Finance in the same request.
refresh - indicates whether the data should be requested again to Yahoo Financepublic void setStats(StockStats stats)
public StockDividend getDividend()
getDividend(boolean)public StockDividend getDividend(boolean refresh)
When the dividend data get refreshed, it will automatically also refresh the quote and statistics data of the stock from Yahoo Finance in the same request.
refresh - indicates whether the data should be requested again to Yahoo Financepublic void setDividend(StockDividend dividend)
public java.util.List<HistoricalQuote> getHistory()
If the historical quotes are not available yet, the following characteristics will be used for the request:
There are several more methods available that allow you to define some characteristics of the historical data. Calling one of those methods will result in a new request being sent to Yahoo Finance.
getHistory(yahoofinance.histquotes.Interval),
getHistory(java.util.Calendar),
getHistory(java.util.Calendar, java.util.Calendar),
getHistory(java.util.Calendar, yahoofinance.histquotes.Interval),
getHistory(java.util.Calendar, java.util.Calendar, yahoofinance.histquotes.Interval)public java.util.List<HistoricalQuote> getHistory(Interval interval)
interval - the interval of the historical datagetHistory()public java.util.List<HistoricalQuote> getHistory(java.util.Calendar from)
from - start date of the historical datagetHistory()public java.util.List<HistoricalQuote> getHistory(java.util.Calendar from, Interval interval)
from - start date of the historical datainterval - the interval of the historical datagetHistory()public java.util.List<HistoricalQuote> getHistory(java.util.Calendar from, java.util.Calendar to)
from - start date of the historical datato - end date of the historical datagetHistory()public java.util.List<HistoricalQuote> getHistory(java.util.Calendar from, java.util.Calendar to, Interval interval)
from - start date of the historical datato - end date of the historical datainterval - the interval of the historical datagetHistory()public void setHistory(java.util.List<HistoricalQuote> history)
public java.lang.String getSymbol()
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getCurrency()
public void setCurrency(java.lang.String currency)
public java.lang.String getStockExchange()
public void setStockExchange(java.lang.String stockExchange)
public java.lang.String toString()
toString in class java.lang.Objectpublic void print()