uk.ac.liv.auction.core
Interface ShoutEngine

All Superinterfaces:
Resetable
All Known Implementing Classes:
FourHeapShoutEngine

public interface ShoutEngine
extends Resetable

Interface for classes providing a shout management service for auctioneers. It is envisaged that there could be many different classes of shout management service, e.g. 4heap memory resident, 4heap with persistence and crash recovery, etc.

Version:
$Revision: 1.10 $
Author:
Steve Phelps

Method Summary
 java.util.Iterator askIterator()
          Return an iterator that non-destructively iterates over every ask in the auction (both matched and unmatched).
 java.util.Iterator bidIterator()
          Return an iterator that non-destructively iterates over every bid in the auction (both matched and unmatched).
 Shout getHighestMatchedAsk()
          Get the highest matched ask.
 Shout getHighestUnmatchedBid()
          Get the highest unmatched bid in the auction.
 Shout getLowestMatchedBid()
          Get the lowest matched bid in the auction.
 Shout getLowestUnmatchedAsk()
          Get the lowest unmatched ask.
 java.util.List getMatchedShouts()
           Destructively fetch the list of matched bids and asks.
 void newAsk(Shout ask)
           
 void newBid(Shout bid)
           
 void printState()
          Log the current state of the auction.
 void removeShout(Shout shout)
           
 
Methods inherited from interface uk.ac.liv.util.Resetable
reset
 

Method Detail

newBid

public void newBid(Shout bid)
            throws DuplicateShoutException
Throws:
DuplicateShoutException

newAsk

public void newAsk(Shout ask)
            throws DuplicateShoutException
Throws:
DuplicateShoutException

removeShout

public void removeShout(Shout shout)

printState

public void printState()
Log the current state of the auction.


getMatchedShouts

public java.util.List getMatchedShouts()

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 a0 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

public Shout getHighestUnmatchedBid()
Get the highest unmatched bid in the auction.


getLowestMatchedBid

public Shout getLowestMatchedBid()
Get the lowest matched bid in the auction.


getLowestUnmatchedAsk

public Shout getLowestUnmatchedAsk()
Get the lowest unmatched ask.


getHighestMatchedAsk

public Shout getHighestMatchedAsk()
Get the highest matched ask.


askIterator

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


bidIterator

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