Football1 Docs
Fall 2026
API

# o1.football1

package o1.football1

## Members list

### Type members

#### Classlikes

class Club(val `name`: 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. Club objects are immutable.

The class `Club` represents football clubs in a match statistics system. Only some very basic information for each club is recorded. Club objects are immutable.

## Parameters

name

  the name of the club

stadium

  the name of the home stadium of the club

## Attributes

Supertypes
  class Object
  trait Matchable
  class Any

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 as follows. When a real-leaf match starts, a match object is created to represent it; the match initially has zero goals. Goals are then added incrementally (by calling addHomeGoal or addAwayGoal) as the match progresses. (This means that a match object has a mutable state.)

## Parameters

away

  the club whose team plays away in the match

home

  the club whose team plays at home in the match

## Attributes

Supertypes
  class Object
  trait Matchable
  class Any

final class testClubAndMatch

## Attributes

Supertypes
  class Object
  trait Matchable
  class Any

### Value members

#### Concrete methods

def testClubAndMatch(): Unit

A small program that uses the classes `Club` and `Match` to keep track of some football matches. To be customized by the student.

A small program that uses the classes `Club` and `Match` to keep track of some football matches. To be customized by the student.

## Attributes