org.bolson.vote
Class RankedVotingSystem

java.lang.Object
  extended by org.bolson.vote.VotingSystem
      extended by org.bolson.vote.RankedVotingSystem
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BordaVotingSystem, Bucklin, Coombs, IRV, STV

public abstract class RankedVotingSystem
extends VotingSystem

Interface for any voting system that inputs a voter's rankings of the choices. Supplies implementations of voteRating which call voteRanking

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.bolson.vote.VotingSystem
debug, NO_VOTE, numc
 
Constructor Summary
RankedVotingSystem(int numCandidates)
           
 
Method Summary
 int voteRating(double[] rating)
           
 int voteRating(float[] rating)
           
 int voteRating(int[] rating)
          Converts rating to ranking and passes to voteRanking.
 
Methods inherited from class org.bolson.vote.VotingSystem
checkRatedVote, getDebugHTML, getDebugText, getNumberOfCandidates, getWinners, getWinners, getWinners, getWinners, htmlSummary, init, isValidRankedVote, isValidRatedVote, name, normalize, normalize, normalize, normalize, normalize, normalizeL2, normalizeL2, normalizeL2, normalizeL2, normalizeL2, stretch, toString, voteRanking, voteRating
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankedVotingSystem

public RankedVotingSystem(int numCandidates)
Method Detail

voteRating

public int voteRating(int[] rating)
Converts rating to ranking and passes to voteRanking.

Specified by:
voteRating in class VotingSystem
Parameters:
rating - An array int[numc]. rating[i] is the rating of choice i. greater values are better.
Returns:
0 on success

voteRating

public int voteRating(float[] rating)
Specified by:
voteRating in class VotingSystem
Parameters:
rating - An array int[N]. rating[i] is the rating of choice i. A rating can be any int value. Higher means more preferred. NO_VOTE for unrated.
Returns:
0 on success

voteRating

public int voteRating(double[] rating)
Specified by:
voteRating in class VotingSystem
Parameters:
rating - An array int[N]. rating[i] is the rating of choice i. A rating can be any int value. Higher means more preferred. NO_VOTE for unrated.
Returns:
0 on success