Packages

class Match extends AnyRef

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

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

Instance Constructors

  1. new Match(home: Club, away: Club)

    home

    the club whose team plays at home in the match

    away

    the club whose team plays away in the match

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addGoal(scorer: Player): Unit

    Records a goal as having been scored by the given player.

    Records a goal as having been scored by the given player. The goal is recorded for the player's own team; no own goals.

  5. def allScorers: Vector[Player]

    Returns a vector that contains all the players who scored in the match.

    Returns a vector that contains all the players who scored in the match. In the vector, all the players who scored for the home team appear (in the order in which they scored) before the players who scored for the away team (also in scoring order amongst themselves). A player will appear in the vector as many times as they scored.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val away: Club
  8. def awayGoals: Int

    Returns the number of goals that have been scored (so far) by the away team.

  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def goalDifference: Int

    Returns the goal difference of the match.

    Returns the goal difference of the match. The sign of the number indicates which team scored more goals.

    returns

    the goal difference as a positive number if the home team won, a negative number if the away team won, or zero in case of a tied match

  14. def hasScorer(possibleScorer: Player): Boolean

    Returns a boolean value indicating whether the given player scored in this match.

  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. val home: Club
  17. def homeGoals: Int

    Returns the number of goals that have been scored (so far) by the home team.

  18. def isAwayWin: Boolean

    Returns a boolean value indicating whether the away team won (or would win if the match ended with the current score).

    Returns a boolean value indicating whether the away team won (or would win if the match ended with the current score). Tied scores produce false.

  19. def isGoalless: Boolean

    Determines whether this match is entirely goalless, that is, whether neither team has scored a single goal.

  20. def isHigherScoringThan(anotherMatch: Match): Boolean

    Determines whether this match has a higher total score than another given match.

    Determines whether this match has a higher total score than another given match.

    returns

    true if more goals were scored in total in this match than in the given match, false otherwise

  21. def isHomeWin: Boolean

    Returns a boolean value indicating whether the home team won (or would win if the match ended with the current score).

    Returns a boolean value indicating whether the home team won (or would win if the match ended with the current score). Tied scores produce false.

  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isTied: Boolean

    Returns a boolean value indicating whether the game ended in a draw (or would do so if the match ended with the current score).

  24. def location: String

    Returns the name of the stadium where the match is played.

    Returns the name of the stadium where the match is played. That is, returns the name of the home team's stadium.

  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  29. def toString: String

    Produces a textual description of the match's current state, in a format illustrated by the examples below.

    Produces a textual description of the match's current state, in a format illustrated by the examples below. In these examples "Liverpool" is the name of the home team, "Everton" the name of the away team, and "Anfield" the name of the home team's stadium.

    Goalless draw (no goals for either side):

    Liverpool vs. Everton at Anfield: tied at nil-nil

    Other tied score (e.g., 2-2):

    Liverpool vs. Everton at Anfield: tied at 2-all

    Home score higher (e.g., 4-0):

    Liverpool vs. Everton at Anfield: 4-0 to Liverpool

    Away score higher (e.g., 2-4):

    Liverpool vs. Everton at Anfield: 4-2 to Everton

    Note that although the name of the home team is always listed first, but the leader's score is shown first, even if the away team is leading.

    Definition Classes
    Match → AnyRef → Any
  30. def totalGoals: Int

    Returns the total number of goals scored by the two teams.

  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. def winner: Option[Club]

    Returns the club whose team won the match (or is about to win it, assuming the current result stands).

    Returns the club whose team won the match (or is about to win it, assuming the current result stands). That is, returns the club who has scored more goals than the other one. The club is wrapped in an Option; None is returned if the game is tied.

  35. def winnerName: String

    Returns the name of the club whose team won the match (or is about to win it, assuming the current result stands).

    Returns the name of the club whose team won the match (or is about to win it, assuming the current result stands). If the game is tied, returns the string "no winner".

  36. def winningScorer: Option[Player]

    Returns the player who scored the so-called "winning goal".

    Returns the player who scored the so-called "winning goal". The winning goal of a match is the first goal for the winning team that was "necessary for the win" in light of the scoreline. For instance, if the score is 4-2 to the home team, then the third goal scored by the home team is the "winning goal". If scores are even, there is no winning goal or winning scorer.

    returns

    the scorer of the winning goal, wrapped in an Option; None if there is no winning goal

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped