Generated with
This document is part of the ebook for O1 (aka CS-A1110 Programming 1), a course at Aalto University.
This document is part of the ebook for O1 (aka CS-A1110 Programming 1), a course at Aalto University.
o1.goodstuff.Experience
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
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)
Attributes
Graph
Reset zoom Hide graph Show graph
Supertypes
Members list
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.
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.
Attributes
Returns true
if the experience has a higher rating than the experience given as a parameter, and false
otherwise.
Returns true
if the experience has a higher rating than the experience given as a parameter, and false
otherwise.
Attributes