Packages

c

o1.people

Member

class Member extends AnyRef

Each instance of class Member represents an individual person, recorded by an (imaginary) society-membership app. A member has a number of basic attributes such as a name and a year of birth.

Once created, a Member object is immutable; to represent changes in a person, one should create a new instance of the class.

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

Instance Constructors

  1. new Member(id: Int, name: String, yearOfBirth: Int, yearOfDeath: Option[Int])

    id

    a number that uniquely identifies the member from other members of the society

    name

    the member's name

    yearOfBirth

    the year the member was born

    yearOfDeath

    the year the member died (wrapped in an Option; None if the member is alive)

Value Members

  1. val id: Int
  2. def isAlive: Boolean

    Returns a boolean value indicating whether the member is alive or not.

    Returns a boolean value indicating whether the member is alive or not. That is, returns true if the member does not have a year of death,* and false if they do.

  3. val name: String
  4. def toString: String

    Returns a compact string description of the member.

    Returns a compact string description of the member. The description of a dead person has the form "Name(YoB-YoD)"; e.g. "Elvis(1935-1977)". The description of a living person is the same but with no year of death; e.g., "Madonna(1958-)".

    Definition Classes
    Member → AnyRef → Any
  5. val yearOfBirth: Int
  6. val yearOfDeath: Option[Int]