Class Auctioneer

java.lang.Object
  extended by Auctioneer

public class Auctioneer
extends java.lang.Object

the auctioneer class. NOTE: The purpose of this code is to illustrate implementation starting from UML class and sequence diagrams. It may be incomplete and may not compile.


Nested Class Summary
private  class Auctioneer.AuctionCompletedTask
          inner class that extends a TimerTask to provide a callback (run()) that invokes the auctioneer's auctionCompleted() method.
 
Field Summary
private  AuctionListing al
          the auction listing describing the item, bids and other elements
private  ListingArchive arch
          auction listing archive
 
Constructor Summary
Auctioneer(ActiveList activeList, AuctionListing al, ListingArchive arch)
          constructs the Auctioneer.
 
Method Summary
 void auctionCompleted()
          complete an auction.
 void enterBid(Bid bid)
          enter a new bid for an item.
 void scheduleCompletion()
          schedule auction completion.
 boolean validateBid(Bid bid)
          validate a new bid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

al

private AuctionListing al
the auction listing describing the item, bids and other elements


arch

private ListingArchive arch
auction listing archive

Constructor Detail

Auctioneer

public Auctioneer(ActiveList activeList,
                  AuctionListing al,
                  ListingArchive arch)
constructs the Auctioneer. Saves the active list, listing and archive objects.

Method Detail

auctionCompleted

public void auctionCompleted()
complete an auction. This method is invoked asynchronously by a timer object when an auction must be completed. Derived from the "Complete Auction" use case.


enterBid

public void enterBid(Bid bid)
enter a new bid for an item. Derived from the "Bid for Item" use case.

Parameters:
bid - the new bid for this auction.

validateBid

public boolean validateBid(Bid bid)
validate a new bid. Derived from the "Bid For Item" use case.

Parameters:
bid - the new bid for this auction.

scheduleCompletion

public void scheduleCompletion()
schedule auction completion. Derived from the "List Item" use case.