|
||||||||||
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.
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 a visual representation of the stock. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |