edu.cuny.cat.market
Interface Auctioneer

All Superinterfaces:
AuctionEventListener, QuoteProvider
All Known Implementing Classes:
GenericDoubleAuctioneer

public interface Auctioneer
extends QuoteProvider, AuctionEventListener

An interface representing an auctioneer managing shouts in an auction. Different auction rules should be encapsulated in different Auctioneer classes.

An auctioneer is configured with:

Version:
$Revision: 1.13 $
Author:
Steve Phelps

Method Summary
 java.util.Iterator<Shout> askIterator()
           
 double askQuote()
           
 java.util.Iterator<Shout> bidIterator()
           
 double bidQuote()
           
 void clear()
          Perform the clearing operation for the auction; match buyers with sellers and inform the auction of any deals.
 ShoutAcceptingPolicy getAcceptingPolicy()
           
 ChargingPolicy getChargingPolicy()
           
 MarketClearingCondition getClearingCondition()
           
<H extends Helper>
H
getHelper(java.lang.Class<H> type)
           
 java.lang.String getName()
           
 PricingPolicy getPricingPolicy()
           
 QuotingPolicy getQuotingPolicy()
           
 MarketRegistry getRegistry()
           
 Shout getShout(java.lang.String shoutId)
           
 ShoutEngine getShoutEngine()
           
 SubscribingPolicy getSubscribingPolicy()
           
 void newShout(Shout shout)
          Code for handling a new shout in the auction.
 void printState()
          Log the current status of the auction.
 void removeShout(Shout shout)
          Handle a request to retract a shout.
<H extends Helper>
void
setHelper(java.lang.Class<H> type, H helper)
          register a Helper, which can be retrieved and used by AuctioneerPolicy to have additional capabilities that are shared with other policies.
 void setName(java.lang.String name)
           
 
Methods inherited from interface edu.cuny.cat.market.QuoteProvider
getQuote
 
Methods inherited from interface edu.cuny.cat.event.AuctionEventListener
eventOccurred
 

Method Detail

clear

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


newShout

void newShout(Shout shout)
              throws IllegalShoutException
Code for handling a new shout in the auction. Subclasses should override this method if they wish to provide different handling for different auction rules.

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

removeShout

void removeShout(Shout shout)
Handle a request to retract a shout.


getShout

Shout getShout(java.lang.String shoutId)
Parameters:
shoutId - the id of desired shout.
Returns:
the shout with the id

printState

void printState()
Log the current status of the auction.


askIterator

java.util.Iterator<Shout> askIterator()
Returns:
an iteration of asks in the auction.

bidIterator

java.util.Iterator<Shout> bidIterator()
Returns:
an iteration of bids in the auction.

askQuote

double askQuote()
Returns:
the ask market quote.

bidQuote

double bidQuote()
Returns:
the bid market quote.

getShoutEngine

ShoutEngine getShoutEngine()
Returns:
the shout engine used by the auctioneer.

getQuotingPolicy

QuotingPolicy getQuotingPolicy()
Returns:
the quoting policy used in the auction.

getChargingPolicy

ChargingPolicy getChargingPolicy()
Returns:
the charging policy used in the auction.

getClearingCondition

MarketClearingCondition getClearingCondition()
Returns:
the clearning condition used in the auction.

getPricingPolicy

PricingPolicy getPricingPolicy()
Returns:
the pricing policy used in the auction.

getAcceptingPolicy

ShoutAcceptingPolicy getAcceptingPolicy()
Returns:
the shout accepting policy in the auction.

getSubscribingPolicy

SubscribingPolicy getSubscribingPolicy()
Returns:
the subscribing policy in the auction.

getRegistry

MarketRegistry getRegistry()
Returns:
the registry used by the specialist.

getHelper

<H extends Helper> H getHelper(java.lang.Class<H> type)
Parameters:
type - a class or subclass of Helper
Returns:
the instance of the given helper type previously registered at this auctioneer; null if no such a helper exists.

setHelper

<H extends Helper> void setHelper(java.lang.Class<H> type,
                                  H helper)
register a Helper, which can be retrieved and used by AuctioneerPolicy to have additional capabilities that are shared with other policies.

Parameters:
type -
helper -

getName

java.lang.String getName()
Returns:
the name of the auction.

setName

void setName(java.lang.String name)
Parameters:
name - the name for the auction.