o1.goodstuff

package o1.goodstuff

Members list

Packages

Type members

Classlikes

class Category(val name: String, val unit: String)

The class Category represents categories of experiences in the GoodStuff diary application. A single category contains zero or more experiences that are similar in some way and are purchased in units of the same kind. A category object could be used represent hotel experiences, for instance, or wines the diarist has tasted.

The class Category represents categories of experiences in the GoodStuff diary application. A single category contains zero or more experiences that are similar in some way and are purchased in units of the same kind. A category object could be used represent hotel experiences, for instance, or wines the diarist has tasted.

A category object has a mutable state: A newly created category has no experiences yet; experiences must be added to it using the addExperience method.

Parameters

name

the name of the category, such as "Hotel" or "Wine"

unit

the name of the pricing unit associated with the experiences in this category, such as "night" or "bottle"

Attributes

Supertypes
class Object
trait Matchable
class Any
class Experience(val name: String, val description: String, val price: Double, val rating: Int)

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

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.

Parameters

description

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

name

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

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)

Attributes

Supertypes
class Object
trait Matchable
class Any