|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bolson.vote.VotingSystem org.bolson.vote.RankedVotingSystem
public abstract class RankedVotingSystem
Interface for any voting system that inputs a voter's rankings of the choices. Supplies implementations of voteRating which call voteRanking
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 |
---|
public RankedVotingSystem(int numCandidates)
Method Detail |
---|
public int voteRating(int[] rating)
voteRating
in class VotingSystem
rating
- An array int[numc].
rating[i] is the rating of choice i. greater values are better.
public int voteRating(float[] rating)
voteRating
in class VotingSystem
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.
public int voteRating(double[] rating)
voteRating
in class VotingSystem
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |