public abstract class AbstractVoteCountingStrategy extends Object implements VoteCountingStrategy
VoteCountingStrategy.| Modifier and Type | Field and Description |
|---|---|
protected Comparator<VoteForChoice> |
voteValueComparator |
static BigDecimal |
ZERO_D |
| Constructor and Description |
|---|
AbstractVoteCountingStrategy() |
| Modifier and Type | Method and Description |
|---|---|
Map<Voter,List<Set<String>>> |
buildVoterSortedChoices(Set<Voter> voters) |
Set<String> |
getAllChoiceIds(Set<Voter> voters) |
Map<String,ChoiceScore> |
newEmptyChoiceScoreMap(Set<Voter> voters) |
protected VoteCountingResult |
orderByValues(Collection<ChoiceScore> scores) |
List<Set<String>> |
sortVoteForChoices(Set<VoteForChoice> voteForChoices) |
GroupVoteCountingResult |
votecount(GroupOfVoter group)
Vote count for the given
group of voters and return the
result of it. |
protected void |
voteCount(GroupOfVoter group,
Set<GroupOfVoter> groups) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvotecountpublic static final BigDecimal ZERO_D
protected final Comparator<VoteForChoice> voteValueComparator
public final GroupVoteCountingResult votecount(GroupOfVoter group)
VoteCountingStrategygroup of voters and return the
result of it.votecount in interface VoteCountingStrategygroup - the group of voters and their votes.public Map<String,ChoiceScore> newEmptyChoiceScoreMap(Set<Voter> voters)
protected VoteCountingResult orderByValues(Collection<ChoiceScore> scores)
public Map<Voter,List<Set<String>>> buildVoterSortedChoices(Set<Voter> voters)
public List<Set<String>> sortVoteForChoices(Set<VoteForChoice> voteForChoices)
protected void voteCount(GroupOfVoter group, Set<GroupOfVoter> groups)
Copyright © 2009–2013 CodeLutin. All rights reserved.