|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
uk.ac.liv.auction.core.AuctionImpl
An abstract implementation of Auction that provides basic logging facilities.
| Field Summary | |
protected Auctioneer |
auctioneer
The plugable auction rules to use for this auction, e.g. |
protected boolean |
closed
Flag indicating whether the auction is currently closed. |
protected java.util.HashMap |
eventListeners
|
protected long |
id
A unique id for this auction. |
protected Shout |
lastAsk
The last ask placed in the auction. |
protected Shout |
lastBid
The last bid placed in the auction. |
protected Shout |
lastShout
The last shout placed in the auction. |
protected java.lang.String |
name
The name of this auction. |
protected AuctionReport |
report
The optional MarketDataLogger to log data to. |
| Constructor Summary | |
AuctionImpl()
|
|
AuctionImpl(java.lang.String name)
|
|
| Method Summary | |
void |
addAuctionEventListener(AuctionEventListener listener)
|
void |
addAuctionEventListener(java.lang.Class eventClass,
AuctionEventListener listener)
|
void |
addListener(java.util.LinkedList listeners,
AuctionEventListener listener)
|
void |
addReport(AuctionReport newReport)
Add a new market data logger. |
void |
close()
Close the auction. |
boolean |
closed()
Returns true if the auction is closed. |
protected void |
fireEvent(AuctionEvent event)
|
Auctioneer |
getAuctioneer()
Return the current auctioneer for this auction. |
Shout |
getLastShout()
Return the last shout placed in the auction. |
java.lang.String |
getName()
|
MarketQuote |
getQuote()
|
AuctionReport |
getReport()
Get the current data logger |
AuctionReport |
getReport(java.lang.Class reportClass)
|
java.util.Map |
getResults()
Return a Map of all of the variables in all of the reports configured for this auction. |
void |
informAuctionClosed()
|
void |
informAuctionOpen()
|
void |
informEndOfDay()
|
protected void |
initialise()
|
void |
newShout(Shout shout)
Handle a new shout in the auction. |
void |
printState()
Report the state of the auction. |
protected void |
recordShout(Shout shout)
|
void |
removeAuctionEventListener(AuctionEventListener listener)
|
void |
removeAuctionEventListener(java.lang.Class eventClass,
AuctionEventListener listener)
|
void |
removeShout(Shout shout)
Remove a shout from the auction. |
void |
reset()
Reinitialise our state to the original settings. |
void |
setAuctioneer(Auctioneer auctioneer)
|
void |
setName(java.lang.String name)
Change the name of this auction. |
void |
setReport(AuctionReport logger)
Assign a data logger |
java.lang.String |
toString()
|
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface uk.ac.liv.auction.core.Auction |
clear, getDay, getNumberOfTraders, getRemainingTime, getRound, shoutAccepted, transactionsOccured |
| Field Detail |
protected java.lang.String name
protected long id
protected Shout lastShout
protected Shout lastBid
protected Shout lastAsk
protected boolean closed
protected Auctioneer auctioneer
protected AuctionReport report
protected java.util.HashMap eventListeners
| Constructor Detail |
public AuctionImpl(java.lang.String name)
public AuctionImpl()
| Method Detail |
protected void initialise()
public void reset()
Resetable
reset in interface Resetablepublic void setAuctioneer(Auctioneer auctioneer)
public Auctioneer getAuctioneer()
Auction
getAuctioneer in interface Auctionpublic boolean closed()
Auction
closed in interface Auctionpublic void close()
close in interface Auction
public Shout getLastShout()
throws ShoutsNotVisibleException
Auction
getLastShout in interface AuctionShoutsNotVisibleExceptionpublic void setReport(AuctionReport logger)
public AuctionReport getReport()
public void setName(java.lang.String name)
name - The new name of the auction.public MarketQuote getQuote()
getQuote in interface QuoteProviderpublic java.lang.String getName()
public void removeShout(Shout shout)
Auction
removeShout in interface Auction
public void newShout(Shout shout)
throws AuctionException
newShout in interface Auctionshout - The new shout in the auction.
AuctionExceptionprotected void recordShout(Shout shout)
public void printState()
Auction
printState in interface Auctionpublic void addReport(AuctionReport newReport)
newReport - The new logger to add.
public void addListener(java.util.LinkedList listeners,
AuctionEventListener listener)
public void addAuctionEventListener(AuctionEventListener listener)
public void removeAuctionEventListener(AuctionEventListener listener)
public void addAuctionEventListener(java.lang.Class eventClass,
AuctionEventListener listener)
public void removeAuctionEventListener(java.lang.Class eventClass,
AuctionEventListener listener)
protected void fireEvent(AuctionEvent event)
public void informAuctionClosed()
public void informEndOfDay()
public void informAuctionOpen()
public java.util.Map getResults()
ReportVariablepublic AuctionReport getReport(java.lang.Class reportClass)
getReport in interface Auctionpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||