Email Answering System
Version 1.0

com.ninecode.email.beans.slave.stock
Class StockBean

java.lang.Object
  |
  +--com.ninecode.email.util.WebBean
        |
        +--com.ninecode.email.beans.slave.stock.StockBean

public class StockBean
extends WebBean

Fetch stock info from etrade.ca.

Author:
Derrick Oswald

Field Summary
protected  String mExchange
          The exchange.
protected  String mTicker
          The stock ticker symbol.
 
Fields inherited from class com.ninecode.email.util.WebBean
mBufferSize, mUrl, newline, newline_size
 
Constructor Summary
StockBean()
          Creates a new instance of StockBean
 
Method Summary
protected  byte[] fetch()
          Override fetch to do POST operation.
static byte[] get(InputStream in)
          Return the contents of a stream.
 String getContent(boolean links)
           
 String getExchange()
          Getter for property exchange.
 String getExchangeString()
          Get the exchange as a string.
 String getText()
           
 String getTicker()
          Getter for property Ticker.
 String help()
           
static void main(String[] args)
          Unit test.
 void setExchange(String exchange)
          Setter for property exchange.
 void setText(String text)
           
 void setTicker(String ticker)
          Setter for property Ticker.
 String toString()
          Generate a string representing the state of this bean.
 
Methods inherited from class com.ninecode.email.util.WebBean
carriage_return, collapse, getContent, getContent, getURL, setURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mTicker

protected String mTicker
The stock ticker symbol.


mExchange

protected String mExchange
The exchange.

Constructor Detail

StockBean

public StockBean()
Creates a new instance of StockBean

Method Detail

getTicker

public String getTicker()
Getter for property Ticker.

Returns:
Value of property Ticker.

setTicker

public void setTicker(String ticker)
Setter for property Ticker.


getExchange

public String getExchange()
Getter for property exchange.

Returns:
Value of property exchange.

setExchange

public void setExchange(String exchange)
Setter for property exchange.

Parameters:
exchange - New value of property exchange.

getExchangeString

public String getExchangeString()
Get the exchange as a string.

Returns:
The current exchange name.

help

public String help()

setText

public void setText(String text)

get

public static byte[] get(InputStream in)
                  throws IOException
Return the contents of a stream.

Parameters:
in - The stream to drain.
Returns:
The contents of the stream.
IOException

getContent

public String getContent(boolean links)
Overrides:
getContent in class WebBean

fetch

protected byte[] fetch()
                throws IOException
Override fetch to do POST operation.

IOException

getText

public String getText()

toString

public String toString()
Generate a string representing the state of this bean.

Overrides:
toString in class WebBean
Returns:
A string of the form:
 Edmonton Alberta
 

main

public static void main(String[] args)
Unit test.

Parameters:
args - The free form argument that is the ticker symbol to get a quote for in args[0].

Email Answering System
Version 1.0

Copyright © 2003 Derrick Oswald. All rights reserved.