Interface Vote
- All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject, OsidRelationship, Temporal
A Vote is a relationship between a Candidate and a
voter .
-
Method Summary
Modifier and TypeMethodDescriptionGets theCandidate.Gets the candidateId.getVoter()Gets the resource of the voter.getVoteRecord(Type voteRecordType) Gets the vote record corresponding to the givenVoterecordType.This method is used to retrieve an object implementing the requested record.Gets the resourceIdof the voter.longgetVotes()Gets the number of votes cast for this candidate.Gets the agent of the voter.Gets the agentIdof the voter.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.Methods inherited from interface OsidRelationship
getEndReason, getEndReasonId, hasEndReasonModifier and TypeMethodDescriptionGets a state indicating why this relationship has ended.Gets a stateIdindicating why this relationship has ended.booleanTests if a reason this relationship came to an end is known.Methods inherited from interface Temporal
getEndDate, getStartDate, isEffectiveModifier and TypeMethodDescriptionGets the end date.Gets the start date.booleanTests if the current date is within the start end end dates inclusive.
-
Method Details
-
getCandidateId
Id getCandidateId()Gets the candidateId.- Returns:
- a candidate
Id - Compliance:
mandatory- This method must be implemented.
-
getCandidate
Gets theCandidate.- Returns:
- the candidate
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getVoterId
Id getVoterId()Gets the resourceIdof the voter.- Returns:
- the resource
Id - Compliance:
mandatory- This method must be implemented.
-
getVoter
Gets the resource of the voter.- Returns:
- the resource
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getVotingAgentId
Id getVotingAgentId()Gets the agentIdof the voter.- Returns:
- the agent
Id - Compliance:
mandatory- This method must be implemented.
-
getVotingAgent
Gets the agent of the voter.- Returns:
- the agent
- Throws:
OperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getVotes
long getVotes()Gets the number of votes cast for this candidate.- Returns:
- the number of votes cast
- Compliance:
mandatory- This method must be implemented.
-
getVoteRecord
Gets the vote record corresponding to the givenVoterecordType.This method is used to retrieve an object implementing the requested record. ThevoteRecordTypemay be theTypereturned ingetRecordTypes()or any of its parents in aTypehierarchy wherehasRecordType(voteRecordType)istrue.- Parameters:
voteRecordType- the type of the record to retrieve- Returns:
- the vote record
- Throws:
NullArgumentException-voteRecordTypeisnullOperationFailedException- unable to complete requestUnsupportedException-hasRecordType(voteRecordType)isfalse- Compliance:
mandatory- This method must be implemented.
-