Class Voter
java.lang.Object
org.episteme.social.sociology.Role
org.episteme.social.politics.Voter
- All Implemented Interfaces:
Serializable, Commented, ComprehensiveIdentification, Identified<Identification>, Named, Temporal<TimeCoordinate>
Represents a person participating in a voting process.
A voter manages their ballots across multiple rounds of voting.
* @version 2.0
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Field Summary
Fields inherited from class Role
CLIENT, OBSERVER, SERVER, SUPERVISOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcastBallot(Ballot ballot) Casts a ballot for the current round.getBallotForRoundI(int i) Retrieves the ballot cast at a specific round.Returns the list of all ballots cast by this voter.Retrieves the most recent ballot.intReturns the current round number according to this voter's activity.booleanhasVotedAtRoundI(int i) Checks if the voter has cast their vote in a specific round.Methods inherited from class Role
equals, getId, getIndividual, getKind, getSituation, getTraits, getWhen, hashCode, setKind, setTimestamp, toStringMethods inherited from interface Commented
getComments, getTrait, setCommentsMethods inherited from interface ComprehensiveIdentification
getName, getTrait, setName, setTrait
-
Constructor Details
-
Voter
Creates a new Voter role.- Parameters:
individual- the individual casting voteselection- the context of the vote
-
-
Method Details
-
getBallotForRoundI
Retrieves the ballot cast at a specific round.- Parameters:
i- the round number (1-indexed)- Returns:
- the cast ballot
-
getBallots
-
getCurrentBallot
-
castBallot
Casts a ballot for the current round.- Parameters:
ballot- the ballot to cast
-
hasVotedAtRoundI
public boolean hasVotedAtRoundI(int i) Checks if the voter has cast their vote in a specific round.- Parameters:
i- the round number (1-indexed)- Returns:
- true if they voted
-
getCurrentRoundForVoter
public int getCurrentRoundForVoter()Returns the current round number according to this voter's activity.- Returns:
- current round count
-