STAR++ v0.2.2
C++ implementation of STAR voting
Loading...
Searching...
No Matches
Star::Seat Class Reference

The Seat class contains the outcome for a specific seat in a given election. More...

#include <star/seat.h>

Public Member Functions

 Seat ()
 
 Seat (const QString &winner, const QualifierResult &qualifierResult=QualifierResult())
 
 Seat (const QualifierResult &qualifierResult)
 
bool isExceptionFilled () const
 
bool isFilled () const
 
bool isNull () const
 
bool isUpset () const
 
bool operator!= (const Seat &other) const
 
bool operator== (const Seat &other) const
 
QualifierResult qualifierResult () const
 
QString winner () const
 

Detailed Description

A seat consists of a winner and QualifierResult that details how that winner and their opponent were seeded into the runoff phase of the election they belong to. If a seat could not be filled, it will contain no winner and its QualifierResult will contain the unresolvable tie that prevented its completion if it occurred during the scoring round. Otherwise the tie was between the candidates in the runoff.

See also
Calculator::Option::AllowTrueTies.
Election.

Constructor & Destructor Documentation

◆ Seat() [1/3]

Star::Seat::Seat ( )

Constructs a null seat.

See also
isNull().

◆ Seat() [2/3]

Star::Seat::Seat ( const QualifierResult qualifierResult)

Constructs an unfilled seat with qualifier result qualifierResult.

See also
isFilled().

◆ Seat() [3/3]

Star::Seat::Seat ( const QString &  winner,
const QualifierResult qualifierResult = QualifierResult() 
)

Constructs a seat with the winner winner and qualifier result qualifierResult.

Member Function Documentation

◆ isExceptionFilled()

bool Star::Seat::isExceptionFilled ( ) const

Returns true if the seat was filled via special exception; otherwise, returns false.

Exceptions to the normal seat filling process include:

If this is the case, the seat's qualifier result will be null.

◆ isFilled()

bool Star::Seat::isFilled ( ) const

Returns true if the seat was successfully filled; otherwise, returns false.

See also
Election::isComplete(), winner(), and Calculator::Option::AllowTrueTies.

◆ isNull()

bool Star::Seat::isNull ( ) const

Returns true if the seat is null; otherwise, returns false.

◆ isUpset()

bool Star::Seat::isUpset ( ) const

Returns true if the seat's winner is its second seed instead of its first seed, and the candidates were not simultaneously seeded; otherwise, returns false.

See also
QualifierResult::isSeededSimultaneously().

◆ operator!=()

bool Star::Seat::operator!= ( const Seat other) const

Returns true if this seat is not the same as other; otherwise, returns false.

See also
operator==().

◆ operator==()

bool Star::Seat::operator== ( const Seat other) const

Returns true if this seat is the same as other; otherwise, returns false.

See also
operator!=().

◆ qualifierResult()

QualifierResult Star::Seat::qualifierResult ( ) const

Returns the qualifier result of the runoff qualifier that was performed while filling the seat.

See also
isFilled() and winner().

◆ winner()

QString Star::Seat::winner ( ) const

Returns the candidate that won the seat.

See also
isFilled() and qualifierResult().

The documentation for this class was generated from the following files: