Interface VoterAllocation
- All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject
An allocation of votes for an individual resource or a resource group.
-
Method Summary
Modifier and TypeMethodDescriptionlongGets the maximum number of candidates for which this resource can vote.longGets the maximum votes per candidate the resource can cast in this race.getRace()Gets the race of the vote.Gets the raceIdof the vote.longGets the total number of votes the resource can cast in this race.getVoter()Gets theResource.getVoterAllocationRecord(Type voterAllocationRecordType) Gets the voter allocation record corresponding to the givenVoterAllocationrecordType.Gets the resourceId.booleanTests if this resource can vote for a limited number of candidates.booleanTests if this resource gets the number of votes cast for a candidate when the candidate is no longer running in a race.Methods inherited from interface Browsable
getProperties, getPropertiesByRecordTypeModifier and TypeMethodDescriptionGets a list of properties.getPropertiesByRecordType(Type recordType) Gets a list of properties corresponding to the specified record type.Methods inherited from interface Extensible
getRecordTypes, hasRecordTypeModifier and TypeMethodDescriptionGets the record types available in this object.booleanhasRecordType(Type recordType) Tests if this object supports the given recordType.Methods inherited from interface Identifiable
getId, isCurrentMethods inherited from interface OsidObject
getDescription, getDisplayName, getGenusType, isOfGenusTypeModifier and TypeMethodDescriptionGets the description associated with this instance of this OSID object.Gets the preferred display name associated with this instance of this OSID object appropriate for display to the user.Gets the genus type of this object.booleanisOfGenusType(Type genusType) Tests if this object is of the given genusType.
-
Method Details
-
getRaceId
Id getRaceId()Gets the raceIdof the vote.- Returns:
- the ballot
Id - Compliance:
mandatory- This method must be implemented.
-
getRace
Gets the race of the vote.- Returns:
- the race
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getVoterId
Id getVoterId()Gets the resourceId.- Returns:
- a resource
Id - Compliance:
mandatory- This method must be implemented.
-
getVoter
Gets theResource.- Returns:
- the resource
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getTotalVotes
long getTotalVotes()Gets the total number of votes the resource can cast in this race.- Returns:
- the number of votes
- Compliance:
mandatory- This method must be implemented.
-
getMaxVotesPerCandidate
long getMaxVotesPerCandidate()Gets the maximum votes per candidate the resource can cast in this race.- Returns:
- the max votes per candidate
- Compliance:
mandatory- This method must be implemented.
-
hasMaxCandidates
boolean hasMaxCandidates()Tests if this resource can vote for a limited number of candidates.- Returns:
trueif a limit on the number of candidates exists,falseif no limit exists- Compliance:
mandatory- This method must be implemented.
-
getMaxCandidates
long getMaxCandidates()Gets the maximum number of candidates for which this resource can vote.- Returns:
- the maximum candidates
- Throws:
IllegalStateException-hasMaxCandidates()isfalse- Compliance:
mandatory- This method must be implemented.
-
reallocatesVotesWhenCandidateDrops
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.- Returns:
trueif votes are returned to the resource when the candidate drops from the race,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
getVoterAllocationRecord
VoterAllocationRecord getVoterAllocationRecord(Type voterAllocationRecordType) throws OperationFailedException Gets the voter allocation record corresponding to the givenVoterAllocationrecordType. This method is used to retrieve an object implementing the requested record. ThevoterAllocationRecordTypemay be theTypereturned ingetRecordTypes()or any of its parents in aTypehierarchy wherehasRecordType(voterAllocationRecordType)istrue.- Parameters:
voterAllocationRecordType- the type of the record to retrieve- Returns:
- the voter allocation record
- Throws:
NullArgumentException-voterAllocationRecordTypeisnullOperationFailedException- unable to complete requestUnsupportedException-hasRecordType(voterAllocationRecordType)isfalse- Compliance:
mandatory- This method must be implemented.
-