Candidate

o1.election.Candidate
class Candidate(val name: String, val votes: Int, val party: String)

Represents a candidate in an election results application.

A candidate object is immutable.

Parameters

name

the candidate’s name

votes

the number of votes received by the candidate

party

the name (or abbreviation) of the candidate’s party

Attributes

Supertypes
class Object
trait Matchable
class Any

Members list

Keywords
  • no keywords
  • infix
  • override

Value members

Concrete methods

infix def >(another: Candidate): Boolean

Determines if the candidate has more votes than the other, given candidate.

Determines if the candidate has more votes than the other, given candidate.

override def toString: String

Returns a short textual description of the candidate.

Returns a short textual description of the candidate.

Definition Classes
Any

Concrete fields

val name: String
val party: String
val votes: Int