Packages

c

o1.auctionhouse

AuctionHouse

class AuctionHouse extends AnyRef

The class AuctionHouse represents electronic auction houses. It provides methods for adding auctions and producing statistics about the items being sold, among other things.

This version of class AuctionHouse can only handle English-style auctions (of type EnglishAuction). Other ways of selling items are not supported.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AuctionHouse
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new AuctionHouse(name: String)

    name

    the name of the auction house

Value Members

  1. def addItem(item: EnglishAuction): Unit

    Adds the given auction to the auction house.

  2. def averagePrice: Double

    Returns the current average price of all the items that have been put up for sale in this auction house.

    Returns the current average price of all the items that have been put up for sale in this auction house. The average is computed from the prices of all auctions, be they open or closed.

  3. val name: String
  4. def nextDay(): Unit

    Records one day as having passed.

    Records one day as having passed. This is equivalent to calling auction.advanceOneDay() for each of the auctions in this auction house.

    See also

    EnglishAuction.advanceOneDay

  5. def numberOfOpenItems: Int

    Returns the number of auctions in this auction house that are currently open.

  6. def priciest: Option[EnglishAuction]

    Returns the priciest item in the auction house, that is, the item whose current price is the highest.

    Returns the priciest item in the auction house, that is, the item whose current price is the highest. Both open and closed items are considered. The item is returned in an Option wrapper; if there are no auctions at all, None is returned.

  7. def purchasesOf(buyer: String): Vector[EnglishAuction]

    Returns a collection that contains the purchases of a single buyer.

    Returns a collection that contains the purchases of a single buyer. This means all the (open or closed) items that have either already been bought by the given person, or that have the person as the highest bidder.

    buyer

    the name of the buyer whose purchases should be returned

  8. def removeItem(item: EnglishAuction): Unit

    Removes the given auction from the auction house, assuming it was there.

  9. def toString: String

    Produces a textual representation of this auction house.

    Produces a textual representation of this auction house.

    Definition Classes
    AuctionHouse → AnyRef → Any
  10. def totalPrice: Int

    Returns the current total price of all the items that have been put up for sale in this auction house.

    Returns the current total price of all the items that have been put up for sale in this auction house. The total includes the prices of all auctions, be they open or closed.