|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.tdk.sampleapi.StockSymbol
StockSymbol class represents a ticker symbol. Can be used to retrieve the quote.
Field Summary | |
static int |
timeout
Timeout for Quote retrieval operation in milliseconds. |
Constructor Summary | |
StockSymbol(java.lang.String symbol)
Creates a new StockSymbol object. |
Method Summary | |
java.lang.String |
getName()
Returns the name of the stock. |
abstract Quote |
getQuote()
Gets the current quote of the stock. |
java.awt.Component |
getVisualComponent()
Gets/updates a visual representation of the stock. |
Quote |
waitQoute()
This method asynchroniously invokes getQuote() and waits timeout milleseconds. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int timeout
GetQuoteException
Constructor Detail |
public StockSymbol(java.lang.String symbol)
StockSymbol
object.
symbol
- Name (ticker symbol) of the stock
java.lang.NullPointerException
- if the specified symbol is null
Method Detail |
public java.awt.Component getVisualComponent()
getQuote
method.
If the quote cannot be retrieved due to a GetQuoteException
,
the container displays a String
of the form:
symbol + ": data not available"
The component is initially invisible and is not added to
any container.
The same component is returned for each repetitive call.
Subclasses may override this method to include additional data
such as charts.
Component
object representing the Stock
public abstract Quote getQuote() throws GetQuoteException
Quote
value
GetQuoteException
- if an i/o exception occurs during
stock retrievalpublic java.lang.String getName()
public Quote waitQoute() throws GetQuoteException
timeout
milleseconds.
GetQuoteException
- if i/o exception occured during
stock retrieval, or getQuote() does not return for timout
millisecondstimeout
,
getQuote()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |