public interface VoterAllocation extends OsidObject
An allocation of votes for an individual resource or a resource group.
Modifier and Type | Method and Description |
---|---|
long |
getMaxCandidates()
Gets the maximum number of candidates for which this resource can
vote.
|
long |
getMaxVotesPerCandidate()
Gets the maximum votes per candidate the resource can cast in this
race.
|
Race |
getRace()
Gets the race of the vote.
|
Id |
getRaceId()
Gets the race
Id of the vote. |
long |
getTotalVotes()
Gets the total number of votes the resource can cast in this race.
|
Resource |
getVoter()
Gets the
Resource. |
VoterAllocationRecord |
getVoterAllocationRecord(Type voterAllocationRecordType)
Gets the voter allocation record corresponding to the given
VoterAllocation record Type. |
Id |
getVoterId()
Gets the resource
Id. |
boolean |
hasMaxCandidates()
Tests if this resource can vote for a limited number of candidates.
|
boolean |
reallocatesVotesWhenCandidateDrops()
Tests if this resource gets the number of votes cast for a candidate
when the candidate is no longer running in a race.
|
getDescription, getDisplayName, getGenusType, isOfGenusType
getId, isCurrent
getRecordTypes, hasRecordType
getProperties, getPropertiesByRecordType
Id getRaceId()
Id
of the vote. Id
mandatory
- This method must be implemented. Race getRace() throws OperationFailedException
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. Id getVoterId()
Id.
Id
mandatory
- This method must be implemented. Resource getVoter() throws OperationFailedException
Resource.
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. long getTotalVotes()
mandatory
- This method must be implemented. long getMaxVotesPerCandidate()
mandatory
- This method must be implemented. boolean hasMaxCandidates()
true
if a limit on the number of candidates
exists, false
if no limit existsmandatory
- This method must be implemented. long getMaxCandidates()
IllegalStateException
- hasMaxCandidates()
is false
mandatory
- This method must be implemented. boolean reallocatesVotesWhenCandidateDrops()
true
if votes are returned to the resource when
the candidate drops from the race, false
otherwisemandatory
- This method must be implemented. VoterAllocationRecord getVoterAllocationRecord(Type voterAllocationRecordType) throws OperationFailedException
VoterAllocation
record Type.
This method is
used to retrieve an object implementing the requested record. The
voterAllocationRecordType
may be the Type
returned in getRecordTypes()
or any of its
parents in a Type
hierarchy where
hasRecordType(voterAllocationRecordType)
is true
.voterAllocationRecordType
- the type of the record to retrieveNullArgumentException
-
voterAllocationRecordType
is null
OperationFailedException
- unable to complete requestUnsupportedException
-
hasRecordType(voterAllocationRecordType)
is
false
mandatory
- This method must be implemented.