Class ActiveList

java.lang.Object
  extended by ActiveList

public class ActiveList
extends java.lang.Object

the active auction list 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  ListingArchive arch
          auction listing archive
private  java.util.ArrayList<AuctionListing> auctListings
          collection of AuctionListing objects:
 
Constructor Summary
ActiveList(ListingArchive arch)
          constructs the ActiveList
 
Method Summary
 BrowseList getBrowseList()
          creates and returns a browseable list of auction listings.
 AuctionListing listItem(Seller seller, Item it, java.util.Date deadline, double price)
          list a new item.
 void removeListing(AuctionListing al)
          remove auction listing from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

auctListings

private java.util.ArrayList<AuctionListing> auctListings
collection of AuctionListing objects:


arch

private ListingArchive arch
auction listing archive

Constructor Detail

ActiveList

public ActiveList(ListingArchive arch)
constructs the ActiveList

Method Detail

removeListing

public void removeListing(AuctionListing al)
remove auction listing from the list. It is derived from the "Complete Auction" use case.


listItem

public AuctionListing listItem(Seller seller,
                               Item it,
                               java.util.Date deadline,
                               double price)
list a new item. Derived from the "List Item" use case.

Parameters:
it - the new item for sale
deadline - the auction deadline
price - the starting price
Returns:
the new AuctionListing object for this item

getBrowseList

public BrowseList getBrowseList()
creates and returns a browseable list of auction listings. This list is a shallow copy of the active list's content. Derived from the "Browse Items" use case".

Returns:
a browseable list of auction listings