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

The ExpectedElectionResult class compares the results of an election to a known outcome. More...

#include <star/expectedelectionresult.h>

Classes

class  Builder
 The ExpectedElectionResult::Builder class is a utility through expected election result sets can be created. More...
 

Public Member Functions

 ExpectedElectionResult ()
 
bool isNull () const
 
bool operator== (const ElectionResult &result) const
 
bool sameOutcomeAs (const ElectionResult &result)
 
qsizetype seatCount () const
 
QList< Seatseats () const
 

Detailed Description

This class is primarily useful for testing purposes.

See also
ElectionResult.

Constructor & Destructor Documentation

◆ ExpectedElectionResult()

Star::ExpectedElectionResult::ExpectedElectionResult ( )

Constructs a null expected election result.

See also
ExpectedElectionResult::Builder and isNull().

Member Function Documentation

◆ isNull()

bool Star::ExpectedElectionResult::isNull ( ) const

Returns true if the expected election result is null; otherwise, returns false.

◆ operator==()

bool Star::ExpectedElectionResult::operator== ( const ElectionResult result) const

Returns true if this expected election result is the same as the election result result; otherwise, returns false.

See also
sameOutcomeAs().

◆ sameOutcomeAs()

bool Star::ExpectedElectionResult::sameOutcomeAs ( const ElectionResult result)

Returns true if the seat winners of this expected election result are the same as in the election result result; otherwise, returns false.

This method ignores any potential qualifier round differences between the results and only compares the final seat winners.

◆ seatCount()

qsizetype Star::ExpectedElectionResult::seatCount ( ) const

Returns the number of seats that are expected to have been evaluated.

See also
seats().

◆ seats()

QList< Seat > Star::ExpectedElectionResult::seats ( ) const

Returns the list of expected evaluated seats.

See also
seatCount().

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