Class BidHistory

java.lang.Object
  extended by BidHistory

public class BidHistory
extends java.lang.Object

the bid history 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.


Field Summary
private  java.util.ArrayList<Bid> list
          collection of Bid objects.
 
Constructor Summary
BidHistory()
          constructs the bid history
 
Method Summary
 void addBid(Bid bid)
          save a bid to the history.
 Bid getHighestBid()
          return the highest bid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

private java.util.ArrayList<Bid> list
collection of Bid objects. List is an interface type.

See Also:
ArrayList, Bid
Constructor Detail

BidHistory

public BidHistory()
constructs the bid history

Method Detail

getHighestBid

public Bid getHighestBid()
return the highest bid. Returns null if there is no bid in the history. Derived from the "Complete Auction" use case.

Returns:
the highest bid. Returns null if there is no bid for item.

addBid

public void addBid(Bid bid)
save a bid to the history. Derived from the "Bid for Item" use case.

Parameters:
bid - the new bid