Class AuctionListing

java.lang.Object
  extended by AuctionListing

public class AuctionListing
extends java.lang.Object

the auction listing class. It encapsulates all the information and object references necessary for the Auctioneer to do its jobs. 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.


Field Summary
private  Auctioneer auctioneer
           
private  BidHistory bidHist
           
(package private)  java.util.Date deadline
           
private  Item item
           
private  Seller seller
           
(package private)  double startPrice
           
 
Constructor Summary
AuctionListing(Seller seller, Item it, java.util.Date deadline, double price)
          constructs the ActiveList
 
Method Summary
 void addBid(Bid bid)
          process a new bid for this auction.
 Auctioneer getAuctioneer()
          gets the auctioneer object reference.
 java.util.Date getDeadline()
           
 Bid getHighestBid()
          accessor for the current highest bid.
 Item getItem()
           
 double getPrice()
           
 Seller getSeller()
           
 void setAuctioneer(Auctioneer auctioneer)
          sets the auctioneer object reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

item

private Item item

bidHist

private BidHistory bidHist

seller

private Seller seller

auctioneer

private Auctioneer auctioneer

deadline

java.util.Date deadline

startPrice

double startPrice
Constructor Detail

AuctionListing

public AuctionListing(Seller seller,
                      Item it,
                      java.util.Date deadline,
                      double price)
constructs the ActiveList

Parameters:
seller - the Seller object
it - the Item
deadline - the auction deadline
price - the initial auction price
Method Detail

setAuctioneer

public void setAuctioneer(Auctioneer auctioneer)
sets the auctioneer object reference. This mutator is called by the ActiveList when it lists a new item.

Parameters:
auctioneer - the auctioneer reference
See Also:
ActiveList

getAuctioneer

public Auctioneer getAuctioneer()
gets the auctioneer object reference. Called by the buyer role.

Returns:
the auctioneer reference

addBid

public void addBid(Bid bid)
process a new bid for this auction. Derived from "Bid for Item" use case.

Parameters:
bid - the bid object

getHighestBid

public Bid getHighestBid()
accessor for the current highest bid. Returns null if there is no bid. Derived from the "Complete Auction" use case.


getSeller

public Seller getSeller()

getItem

public Item getItem()

getDeadline

public java.util.Date getDeadline()

getPrice

public double getPrice()