net.sourceforge.jasa.market
Class MarketQuote

java.lang.Object
  extended by net.sourceforge.jasa.market.MarketQuote
All Implemented Interfaces:
java.io.Serializable

public class MarketQuote
extends java.lang.Object
implements java.io.Serializable

A price quote summarising the current state of an market.

See Also:
Serialized Form
 

Field Summary
protected  java.lang.Double ask
          The current ask-quote.
protected  java.lang.Double bid
          The current bid-quote.
 
Constructor Summary
MarketQuote(double ask, double bid)
           
MarketQuote(Order ask, Order bid)
           
 
Method Summary
 double getAsk()
           
 double getBid()
           
 double getMidPoint()
           
 boolean isValid()
           
static boolean isValid(double quote)
           
 void setAsk(double ask)
           
 void setBid(double bid)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ask

protected java.lang.Double ask
The current ask-quote. Buyers need to beat this in order for their offers to get matched.


bid

protected java.lang.Double bid
The current bid-quote. Sellers need to ask less than this in order for their offers to get matched.

Constructor Detail

MarketQuote

public MarketQuote(double ask,
                   double bid)

MarketQuote

public MarketQuote(Order ask,
                   Order bid)
Method Detail

setAsk

public void setAsk(double ask)

setBid

public void setBid(double bid)

getAsk

public double getAsk()

getBid

public double getBid()

isValid

public static boolean isValid(double quote)

isValid

public boolean isValid()

getMidPoint

public double getMidPoint()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object