org.bolson.vote
Class NamedIRNRP
java.lang.Object
org.bolson.vote.NameVotingSystem
org.bolson.vote.NamedIRNR
org.bolson.vote.NamedIRNRP
public class NamedIRNRP
- extends NamedIRNR
Instant Runoff Normalized Ratings
Methods inherited from class org.bolson.vote.NameVotingSystem |
defaultMain, denibble, depercentHexify, fromUrlEncoded, getDebug, getImplNames, getIpmlForName, htmlExplain, htmlSummary, nameEqStrToVoteArray, nameEqStrToVoteArray, percentHexify, readVotes, registerImpl, resultsHTMLDisplay, sort, urlEncode, voteNameEqStr, voteOrderSpec, voteRating, voteSpecToNameVoteArray, winnerSummaryHTMLTable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ratingFormat
public static java.text.DecimalFormat ratingFormat
NamedIRNRP
public NamedIRNRP()
init
public int init(java.lang.String[] argv)
- Description copied from class:
NameVotingSystem
- Set options for voting system.
Default implementation sets debug to true if it sees "debug".
Skip pass null entries, which may have been yanked by a subclass.
Unless there's an error, last line should be "return super.init( argv );"
Multi-seat capable implementations should accept an option pair ("seats", <int>) to set the number of seats.
- Overrides:
init
in class NameVotingSystem
- Parameters:
argv
- array of options, just like main()
- Returns:
- 0 on success
deweight
protected void deweight(float[] voterWeight,
NamedIRNR.TallyState[] evict)
getWinners
public NameVotingSystem.NameVote[] getWinners()
- Overrides:
getWinners
in class NamedIRNR
- Returns:
- A sorted array of (name,rating) pairs. Ties can be determined by rating.
htmlSummary
public java.lang.StringBuffer htmlSummary(java.lang.StringBuffer sb)
- Description copied from class:
NameVotingSystem
- Get HTML summary of voting system state.
- Overrides:
htmlSummary
in class NamedIRNR
- Parameters:
sb
- a valid StringBuffer to which HTML summary will be appended.
- Returns:
- same StringBuffer passed in, with HTML summary of voting system state appended.
name
public java.lang.String name()
- Overrides:
name
in class NamedIRNR
- Returns:
- name of this voting system (may be modified by settings from init)