net.sourceforge.jasa.market
Class MarketQuote
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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.
MarketQuote
public MarketQuote(double ask,
double bid)
MarketQuote
public MarketQuote(Order ask,
Order bid)
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