Venice 0.7beta

org.mov.quote
Class IDQuote

java.lang.Object
  extended by org.mov.quote.IDQuote
All Implemented Interfaces:
Quote

public class IDQuote
extends java.lang.Object
implements Quote

Representation of an intra-day stock quote for a given stock, on a given day at a given time.

Author:
Andrew Leppard

Field Summary
 
Fields inherited from interface org.mov.quote.Quote
ASK, BID, DAY_CLOSE, DAY_HIGH, DAY_LOW, DAY_OPEN, DAY_VOLUME
 
Constructor Summary
IDQuote(Symbol symbol, TradingDate date, TradingTime time, int currentVolume, double currentLow, double currentHigh, double dayOpen, double last, double bid, double ask)
          Create a new intra-day stock quote.
 
Method Summary
 double getAsk()
          Return the ask price.
 double getBid()
          Return the bid price.
 TradingDate getDate()
          Return the quote date.
 double getDayClose()
          Return the last trade value.
 double getDayHigh()
          Return the current day high.
 double getDayLow()
          Return the current day low.
 double getDayOpen()
          Return the day open.
 int getDayVolume()
          Return the current day volume.
 double getQuote(int quote)
          Get a single quote.
 Symbol getSymbol()
          Return the stock's symbol.
 TradingTime getTime()
          Return the quote time.
 void setDate(TradingDate date)
          Set the quote date.
 void setSymbol(Symbol symbol)
          Set the symbol for this quote.
 void setTime(TradingTime time)
          Set the quote time.
 java.lang.String toString()
          Return a string representation of the stock quote.
 void verify()
          Clean up the quote.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IDQuote

public IDQuote(Symbol symbol,
               TradingDate date,
               TradingTime time,
               int currentVolume,
               double currentLow,
               double currentHigh,
               double dayOpen,
               double last,
               double bid,
               double ask)
Create a new intra-day stock quote.

Parameters:
symbol - the stock symbol
date - the date of this stock quote
time - the time of this stock quote
currentVolume - the number of shares traded so far today
currentLow - the current day low
currentHigh - the current day high
dayOpen - the opening quote on this date
last - the last trade price
bid - the last bid price
ask - the last ask price
Method Detail

verify

public void verify()
Clean up the quote. This fixes any irregularities that might exist in the quote, such as the day low not being the lowest quote. This function does not throw an exception, unlike EODQuote.verify(). The reason is that the intra-day quotes are downloaded all the time and it would only annoy the user constanty see any warnig messages displayed.


getSymbol

public Symbol getSymbol()
Return the stock's symbol.

Specified by:
getSymbol in interface Quote
Returns:
the symbol

getDate

public TradingDate getDate()
Return the quote date.

Specified by:
getDate in interface Quote
Returns:
the date

getTime

public TradingTime getTime()
Return the quote time.

Returns:
the time

getDayVolume

public int getDayVolume()
Return the current day volume.

Specified by:
getDayVolume in interface Quote
Returns:
the current day volume

getDayLow

public double getDayLow()
Return the current day low.

Specified by:
getDayLow in interface Quote
Returns:
the current day low

getDayHigh

public double getDayHigh()
Return the current day high.

Specified by:
getDayHigh in interface Quote
Returns:
the current day high

getDayOpen

public double getDayOpen()
Return the day open.

Specified by:
getDayOpen in interface Quote
Returns:
the day open

getDayClose

public double getDayClose()
Return the last trade value.

Specified by:
getDayClose in interface Quote
Returns:
the last trade value.

getBid

public double getBid()
Return the bid price.

Returns:
the bid price.

getAsk

public double getAsk()
Return the ask price.

Returns:
the ask price.

setSymbol

public void setSymbol(Symbol symbol)
Set the symbol for this quote.

Parameters:
symbol - the stock symbol

setDate

public void setDate(TradingDate date)
Set the quote date.

Parameters:
date - the date

setTime

public void setTime(TradingTime time)
Set the quote time.

Parameters:
time - the time

getQuote

public double getQuote(int quote)
                throws java.lang.UnsupportedOperationException
Description copied from interface: Quote
Get a single quote.

Specified by:
getQuote in interface Quote
Parameters:
quote - the quote type: Quote.DAY_OPEN, Quote.DAY_CLOSE, Quote.DAY_HIGH, Quote.DAY_LOW, Quote.DAY_VOLUME, Quote.BID, or Quote.ASK
Throws:
java.lang.UnsupportedOperationException - if the quote type is not supported by the quote. For example, end of day quotes do not contain bid or ask prices.

toString

public java.lang.String toString()
Return a string representation of the stock quote.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the stock quote.

Venice 0.7beta