Interface Vote

All Superinterfaces:
Browsable, Extensible, Identifiable, OsidObject, OsidRelationship, Temporal

public interface Vote extends OsidRelationship

A Vote is a relationship between a Candidate and a voter .

  • Method Details

    • getCandidateId

      Id getCandidateId()
      Gets the candidate Id .
      Returns:
      a candidate Id
      Compliance:
      mandatory - This method must be implemented.
    • getCandidate

      Candidate getCandidate() throws OperationFailedException
      Gets the Candidate .
      Returns:
      the candidate
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getVoterId

      Id getVoterId()
      Gets the resource Id of 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 agent Id of the voter.
      Returns:
      the agent Id
      Compliance:
      mandatory - This method must be implemented.
    • getVotingAgent

      Agent getVotingAgent() throws OperationFailedException
      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

      VoteRecord getVoteRecord(Type voteRecordType) throws OperationFailedException
      Gets the vote record corresponding to the given Vote record Type .This method is used to retrieve an object implementing the requested record. The voteRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(voteRecordType) is true .
      Parameters:
      voteRecordType - the type of the record to retrieve
      Returns:
      the vote record
      Throws:
      NullArgumentException - voteRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(voteRecordType) is false
      Compliance:
      mandatory - This method must be implemented.