org.gswing.components.common
Class OverallResult

java.lang.Object
  extended by org.gswing.components.common.Result
      extended by org.gswing.components.common.OverallResult
All Implemented Interfaces:
Serializable

public class OverallResult
extends Result

Purpose: Represents an overall result for an election.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.gswing.components.common.Result
CONSTITUENCY, COUNCIL, entries, GAIN, HOLD, INVALID, LOCAL, m_electorate, m_result, m_totalVotes, m_turnout, NATIONAL, REGIONAL, WIN
 
Constructor Summary
OverallResult(Constituency constituency)
          Constructor.
 
Method Summary
protected  void addUpTotalVotes()
          Go though each entry to find total number of votes for this election.
 int getSeatsWon(String party)
          Get the number of seats won by this party in this overall result.
 void sort()
          Sort the overall results entries by number of votes.
 
Methods inherited from class org.gswing.components.common.Result
add, calculateResult, calculateWinner, cloneEntries, elementAt, getConstituency, getElection, getElectorate, getEntries, getIndex, getMajority, getPercentage, getResult, getTotalVotes, getTurnout, getType, getWinningParty, isLatest, isOldest, removeEntries, setElection, setElectorate, setIndex, setIsLatest, setIsOldest, setTurnout, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OverallResult

public OverallResult(Constituency constituency)
Constructor.

Parameters:
constituency - The constituency name. Normally will be the name of the country.
Method Detail

addUpTotalVotes

protected void addUpTotalVotes()
Go though each entry to find total number of votes for this election.


sort

public void sort()
Sort the overall results entries by number of votes.


getSeatsWon

public int getSeatsWon(String party)
Get the number of seats won by this party in this overall result.

Parameters:
party - The party abbreviation.
Returns:
The number of seats won.


Copyright © 2008. All Rights Reserved.