net.sourceforge.jasa.market
Interface OrderBook

All Known Implementing Classes:
FourHeapOrderBook

public interface OrderBook

 

Method Summary
 void add(Order shout)
           
 java.util.Iterator<Order> askIterator()
          Return an iterator that non-destructively iterates over every ask in the market (both matched and unmatched).
 java.util.Iterator<Order> bidIterator()
          Return an iterator that non-destructively iterates over every bid in the market (both matched and unmatched).
 int getDepth()
           
 Order getHighestMatchedAsk()
          Get the highest matched ask.
 Order getHighestUnmatchedBid()
          Get the highest unmatched bid in the market.
 Order getLowestMatchedBid()
          Get the lowest matched bid in the market.
 Order getLowestUnmatchedAsk()
          Get the lowest unmatched ask.
 java.util.List<Order> getUnmatchedAsks()
           
 java.util.List<Order> getUnmatchedBids()
           
 boolean isEmpty()
           
 java.util.List<Order> matchOrders()
           Destructively fetch the list of matched bids and asks.
 void printState()
          Log the current state of the market.
 void remove(Order shout)
           
 

Method Detail

add

void add(Order shout)
         throws DuplicateShoutException
Throws:
DuplicateShoutException

remove

void remove(Order shout)

printState

void printState()
Log the current state of the market.


matchOrders

java.util.List<Order> matchOrders()

Destructively fetch the list of matched bids and asks. The list is of the form


( b0, a0, b1, a1 .. bn, an )

where bi is the ith bid and ai is the ith ask. A typical auctioneer would clear by matching bi with ai for all i at some price.

Note that the engine's set of matched shouts will become empty as a result of invoking this method.


getHighestUnmatchedBid

Order getHighestUnmatchedBid()
Get the highest unmatched bid in the market.


getLowestMatchedBid

Order getLowestMatchedBid()
Get the lowest matched bid in the market.


getLowestUnmatchedAsk

Order getLowestUnmatchedAsk()
Get the lowest unmatched ask.


getHighestMatchedAsk

Order getHighestMatchedAsk()
Get the highest matched ask.


askIterator

java.util.Iterator<Order> askIterator()
Return an iterator that non-destructively iterates over every ask in the market (both matched and unmatched).


bidIterator

java.util.Iterator<Order> bidIterator()
Return an iterator that non-destructively iterates over every bid in the market (both matched and unmatched).


isEmpty

boolean isEmpty()

getDepth

int getDepth()

getUnmatchedBids

java.util.List<Order> getUnmatchedBids()

getUnmatchedAsks

java.util.List<Order> getUnmatchedAsks()