net.sourceforge.jasa.market.auctioneer
Interface Auctioneer

All Superinterfaces:
MarketEventListener, QuoteProvider
All Known Implementing Classes:
AbstractAuctioneer, AscendingAuctioneer, ClearingHouseAuctioneer, ContinuousDoubleAuctioneer, ContinuousDoubleAuctioneerEE, GenericAuctioneer, PeriodicClearingHouseAuctioneer, SealedBidAuctioneer, TransparentAuctioneer

public interface Auctioneer
extends QuoteProvider, MarketEventListener

Classes implementing this interface define the rules for matching orders in the marketplace and producing the resulting transaction set.

 

Method Summary
 java.util.Iterator<Order> askIterator()
           
 java.util.Iterator<Order> bidIterator()
           
 void clear()
          Perform the clearing operation for the market; match buyers with sellers and inform the market of any deals.
 Account getAccount()
          Get the account which holds any budget surplus or deficit for the auctioneer.
 Order getLastAsk()
           
 Order getLastBid()
           
 Order getLastShout()
           
 Market getMarket()
          Find out which market we are the auctioneer for.
 java.util.List<Order> getUnmatchedAsks()
           
 java.util.List<Order> getUnmatchedBids()
           
 void newOrder(Order order)
          Code for handling a new order in the market.
 boolean orderFilled(Order order)
           
 void printState()
          Log the current state of the market.
 void removeOrder(Order order)
          Cancel an existing order.
 void setMarket(Market auction)
          Specify which market we are the auctioneer for.
 boolean shoutsVisible()
          Return true if the shouts of others are visible.
 boolean transactionsOccurred()
           
 
Methods inherited from interface net.sourceforge.jasa.market.QuoteProvider
getQuote
 

Method Detail

clear

void clear()
Perform the clearing operation for the market; match buyers with sellers and inform the market of any deals.


newOrder

void newOrder(Order order)
              throws IllegalOrderException
Code for handling a new order in the market. Subclasses should override this method if they wish to provide different handling for different market rules.

Parameters:
order - The new shout to be processed
Throws:
IllegalOrderException - Thrown if the order is invalid in some way.

removeOrder

void removeOrder(Order order)
Cancel an existing order.


printState

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


setMarket

void setMarket(Market auction)
Specify which market we are the auctioneer for.


getMarket

Market getMarket()
Find out which market we are the auctioneer for.


askIterator

java.util.Iterator<Order> askIterator()

bidIterator

java.util.Iterator<Order> bidIterator()

shoutsVisible

boolean shoutsVisible()
Return true if the shouts of others are visible.


orderFilled

boolean orderFilled(Order order)
                    throws ShoutsNotVisibleException
Throws:
ShoutsNotVisibleException

transactionsOccurred

boolean transactionsOccurred()
                             throws ShoutsNotVisibleException
Throws:
ShoutsNotVisibleException

getLastAsk

Order getLastAsk()
                 throws ShoutsNotVisibleException
Throws:
ShoutsNotVisibleException

getLastBid

Order getLastBid()
                 throws ShoutsNotVisibleException
Throws:
ShoutsNotVisibleException

getLastShout

Order getLastShout()
                   throws ShoutsNotVisibleException
Throws:
ShoutsNotVisibleException

getAccount

Account getAccount()
Get the account which holds any budget surplus or deficit for the auctioneer. This is useful when implementing non-budget-balanced mechanisms.


getUnmatchedBids

java.util.List<Order> getUnmatchedBids()

getUnmatchedAsks

java.util.List<Order> getUnmatchedAsks()