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

party

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

votes

the number of votes received by the candidate

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

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.

Attributes

override def toString: String

Returns a short textual description of the candidate.

Returns a short textual description of the candidate.

Attributes

Definition Classes
Any

Concrete fields

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