Interface VoteQuery

All Superinterfaces:
Extensible, OsidBrowsableQuery, OsidExtensibleQuery, OsidIdentifiableQuery, OsidObjectQuery, OsidQuery, OsidRelationshipQuery, OsidTemporalQuery, Suppliable

public interface VoteQuery extends OsidRelationshipQuery

This is the query for searching votes. Each method match request produces an AND term while multiple invocations of a method produces a nested OR .

  • Method Details

    • matchCandidateId

      void matchCandidateId(Id candidateId, boolean match)
      Sets the candidate Id for this query.
      Parameters:
      candidateId - a candidate Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - candidateId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearCandidateIdTerms

      void clearCandidateIdTerms()
      Clears the candidate Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsCandidateQuery

      boolean supportsCandidateQuery()
      Tests if a CandidateQuery is available for querying candidates.
      Returns:
      true if a candidate query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getCandidateQuery

      CandidateQuery getCandidateQuery()
      Gets the query for a candidate. Multiple retrievals produce a nested OR term.
      Returns:
      the candidate query
      Throws:
      UnimplementedException - supportsCandidateQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsCandidateQuery()} is {@code true} .
    • clearCandidateTerms

      void clearCandidateTerms()
      Clears the candidate terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchVoterId

      void matchVoterId(Id resourceId, boolean match)
      Sets the resource Id for this query.
      Parameters:
      resourceId - a resource Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - resourceId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearVoterIdTerms

      void clearVoterIdTerms()
      Clears the voter agent Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsVoterQuery

      boolean supportsVoterQuery()
      Tests if a ResourceQuery is available for querying candidates.
      Returns:
      true if a resource query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getVoterQuery

      ResourceQuery getVoterQuery()
      Gets the query for a voter. Multiple retrievals produce a nested OR term.
      Returns:
      the resource query
      Throws:
      UnimplementedException - supportsVoterQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsVoterQuery()} is {@code true} .
    • clearVoterTerms

      void clearVoterTerms()
      Clears the voter terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchVotingAgentId

      void matchVotingAgentId(Id agentId, boolean match)
      Sets the voting agent Id for this query.
      Parameters:
      agentId - a voting agent agent Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - agentId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearVotingAgentIdTerms

      void clearVotingAgentIdTerms()
      Clears the voting agent Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsVotingAgentQuery

      boolean supportsVotingAgentQuery()
      Tests if an AgentQuery is available for querying candidates.
      Returns:
      true if a voting agent query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getVotingAgentQuery

      AgentQuery getVotingAgentQuery()
      Gets the query for a voter. Multiple retrievals produce a nested OR term.
      Returns:
      the agent query
      Throws:
      UnimplementedException - supportsVotingAgentQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsVotingAgentQuery()} is {@code true} .
    • clearVotingAgentTerms

      void clearVotingAgentTerms()
      Clears the voter terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchVotes

      void matchVotes(long from, long to, boolean match)
      Matches the number of votes within the given range inclusive.
      Parameters:
      from - start of range
      to - end of range
      match - true for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - from is greater than to
      Compliance:
      mandatory - This method must be implemented.
    • clearVotesTerms

      void clearVotesTerms()
      Clears the votes terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchMinimumVotes

      void matchMinimumVotes(long votes, boolean match)
      Matches the number of minimum votes inclusive.
      Parameters:
      votes - the numbe rof votes
      match - true for a positive match, false for a negative match
      Compliance:
      mandatory - This method must be implemented.
    • clearMinimumVotesTerms

      void clearMinimumVotesTerms()
      Clears the minimum votes terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchPollsId

      void matchPollsId(Id pollsId, boolean match)
      Sets the polls Id for this query to match terms assigned to polls.
      Parameters:
      pollsId - the polls Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - pollsId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearPollsIdTerms

      void clearPollsIdTerms()
      Clears the polls Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsPollsQuery

      boolean supportsPollsQuery()
      Tests if a PollsQuery is available.
      Returns:
      true if a polls query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getPollsQuery

      PollsQuery getPollsQuery()
      Gets the query for a polls. Multiple retrievals produce a nested OR term.
      Returns:
      the polls query
      Throws:
      UnimplementedException - supportsPollsQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsPollsQuery()} is {@code true} .
    • clearPollsTerms

      void clearPollsTerms()
      Clears the polls terms.
      Compliance:
      mandatory - This method must be implemented.
    • getVoteQueryRecord

      VoteQueryRecord getVoteQueryRecord(Type voteRecordType) throws OperationFailedException
      Gets the vote query record corresponding to the given Vote record Type . Multiple retrievals produce a nested OR term.
      Parameters:
      voteRecordType - a vote query record type
      Returns:
      the vote query record
      Throws:
      NullArgumentException - voteRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(voteRecordType) is false
      Compliance:
      mandatory - This method must be implemented.