Packages

c

o1.goodstuff

Experience

class Experience extends AnyRef

The class Experience represents entries in a user's experience diary. Each entry represents an experience as evaluated by the diarist.

An experience object is immutable once created; there are no methods to change any of its attributes.

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

Instance Constructors

  1. new Experience(name: String, description: String, price: Double, rating: Int)

    name

    a name that identifies the experience, such as "Hotel Anna, Helsinki" or "Sangre de Toro 2007"

    description

    the diarist's description of the experience, such as "Nice but unremarkable"

    price

    the price (per unit) in euros

    rating

    a rating given by the diarist to the experience (from 1 to 10 or on some other scale)

Value Members

  1. def chooseBetter(another: Experience): Experience

    Compares two experiences --- this one and the one given as a parameter --- and returns the one with the higher rating.

    Compares two experiences --- this one and the one given as a parameter --- and returns the one with the higher rating. If both have the same rating, arbitrarily returns one of the two.

  2. val description: String
  3. def isBetterThan(another: Experience): Boolean

    Returns true if the experience has a higher rating than the experience given as a parameter, and false otherwise.

  4. val name: String
  5. val price: Double
  6. val rating: Int
  7. def valueForMoney: Double

    Returns the "value for money" for the experience.

    Returns the "value for money" for the experience. Value for money equals the experience's rating divided by its price.