public class GroupOfVoter extends Object implements Voter, Iterable<Voter>
| Constructor and Description |
|---|
GroupOfVoter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addVoteForChoice(VoteForChoice voteForChoice)
Register a new vote value for this voter.
|
void |
addVoter(Voter voter) |
VoteCountingResult |
getResult() |
Set<VoteForChoice> |
getVoteForChoices()
Gets all the vote for choices registred for this voter.
|
String |
getVoterId()
Gets the voter unique id.
|
Set<Voter> |
getVoters() |
double |
getWeight()
Gets the weight of the voter.
|
Iterator<Voter> |
iterator() |
static GroupOfVoter |
newVoter(String voterId,
double weight,
Set<Voter> voters) |
void |
setResult(VoteCountingResult result) |
void |
setVoterId(String voterId)
Sets the voter id.
|
void |
setVoters(Set<Voter> voters) |
void |
setWeight(double weight)
Sets the voter weight.
|
public static GroupOfVoter newVoter(String voterId, double weight, Set<Voter> voters)
public String getVoterId()
VotergetVoterId in interface Voterpublic double getWeight()
Voterpublic Set<VoteForChoice> getVoteForChoices()
VotergetVoteForChoices in interface Voterpublic void setVoterId(String voterId)
VotersetVoterId in interface VotervoterId - the new voter id to setpublic void setWeight(double weight)
Voterpublic void addVoteForChoice(VoteForChoice voteForChoice)
VoteraddVoteForChoice in interface VotervoteForChoice - new vote value to register for this voterpublic void addVoter(Voter voter)
public VoteCountingResult getResult()
public void setResult(VoteCountingResult result)
Copyright © 2009–2013 CodeLutin. All rights reserved.