o1.football3

package o1.football3

Type members

Classlikes

class Club(val name: String, val abbreviation: String, val stadium: String)

The class Club represents football clubs in a match statistics system. Only some very basic information for each club is recorded. A club object is immutable once created.

The class Club represents football clubs in a match statistics system. Only some very basic information for each club is recorded. A club object is immutable once created.

Value parameters:
name

the name of the club

stadium

the name of the home stadium of the club

The singleton object ExampleLeague provides constants that can be used to experiment with the other classes of this package. More specifically, a bunch of Club and Player objects are provided.

The singleton object ExampleLeague provides constants that can be used to experiment with the other classes of this package. More specifically, a bunch of Club and Player objects are provided.

Usage examples (which assume import ExampleLeague.* has been given):

  • Player("T. Teekkari", ARS)

  • Match(LIV, SOT)

class Match(val home: Club, val away: Club)

The class Match represents match results in a football match statistics program. A match is played between teams from two clubs: a home club and an away club. Goals scored by either team can be added to the match object.

The class Match represents match results in a football match statistics program. A match is played between teams from two clubs: a home club and an away club. Goals scored by either team can be added to the match object.

The class is expected to be used so that a match object with no goals is initially created as a real-life match starts. Goals are added incrementally as the match progresses. (A match object has mutable state.)

Value parameters:
away

the club whose team plays away in the match

home

the club whose team plays at home in the match

class Player(val name: String, val employer: Club)

The class Player represents football players in a match statistics program. Only some very basic information about each player is recorded.

The class Player represents football players in a match statistics program. Only some very basic information about each player is recorded.

A player object is immutable after creation.

Value parameters:
employer

the club the player plays for

name

the name of the player

class Season

The class Season represents a season in a football league, that is, a series of matches between various clubs. The methods in the class allow adding matches to a season as well as calculating some very basic season statistics (the total number of matches, the biggest win during the season, etc.).

The class Season represents a season in a football league, that is, a series of matches between various clubs. The methods in the class allow adding matches to a season as well as calculating some very basic season statistics (the total number of matches, the biggest win during the season, etc.).