Football2 Docs
Fall 2026
API

# o1.football2

package o1.football2

## Members list

### Packages

package o1.football2.gui

### 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.

## 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 addGoal) 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

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.

## Parameters

employer

  the club the player plays for

name

  the name of the player

## Attributes

Supertypes
  class Object
  trait Matchable
  class Any

final class testSingleMatch

## Attributes

Supertypes
  class Object
  trait Matchable
  class Any

### Value members

#### Concrete methods

def testSingleMatch(): Unit

A simple application that you can use to experiment with some methods in the package `o1.football2`. Prompts the user for a couple of clubs and sets up a GUI window for recording goals in a match between them.

A simple application that you can use to experiment with some methods in the package `o1.football2`. Prompts the user for a couple of clubs and sets up a GUI window for recording goals in a match between them.

NOTE TO STUDENTS: In this course, you don’t need to understand how this program works on the inside. It’s enough to know that you can use this file to start the program.

## Attributes