Packages

c

o1.auctionhouse

ItemForSale

abstract class ItemForSale extends AnyRef

The class ItemForSale represents items that have been put up for sale in an (imaginary) electronic auction house. Items can be sold in various ways (fixed price, auctions, etc.); the concrete subclasses of this class represent those different ways. This abstract class captures some of the common characteristics of all different sales.

This simple implementation does not store any seller information.

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

Instance Constructors

  1. new ItemForSale(description: String)

    description

    a short description of the item

Abstract Value Members

  1. abstract def advanceOneDay(): Unit

    Records one day as having passed.

    Records one day as having passed. The effects of this depend on the way the item is sold.

  2. abstract def buyer: Option[String]

    Returns the winner of the item, or the person who is currently leading the bidding, in the case of an auction that is still open.

    Returns the winner of the item, or the person who is currently leading the bidding, in the case of an auction that is still open. The person's name is returned in an Option wrapper; None is returned if nobody has expressed an interest in buying the item.

  3. abstract def isExpired: Boolean

    Determines if the item has expired, that is, if the sale has ended due to a lack of interest and without the item having been sold.

    Determines if the item has expired, that is, if the sale has ended due to a lack of interest and without the item having been sold. How soon this happens depends on the way the item is sold.

  4. abstract def isOpen: Boolean

    Determines if the item is open, that is, if it can still be bought.

    Determines if the item is open, that is, if it can still be bought. Whether this is the case depends on the way the item is sold.

  5. abstract def price: Int

    Returns the current price of the item, that is, the price that the item is selling for at the moment.

    Returns the current price of the item, that is, the price that the item is selling for at the moment. If the item is not open, the sale price (if bought) or closing price (if expired) is returned.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. val description: String
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString: String

    Returns a textual description of the item.

    Returns a textual description of the item. This text is the same as that returned by description.

    Definition Classes
    ItemForSale → AnyRef → Any
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped