public interface CandidateList extends OsidList
Like all OsidLists,
CandidateList
provides a means for accessing Candidate
elements
sequentially either one at a time or many at a time. Examples:
while (cl.hasNext()) { Candidate candidate = cl.getNextCandidate(); }or
while (cl.hasNext()) { Candidate[] candidates = cl.getNextCandidates(cl.available()); }
Modifier and Type | Method and Description |
---|---|
Candidate |
getNextCandidate()
Gets the next
Candidate in this list. |
Candidate[] |
getNextCandidates(long n)
Gets the next set of
Candidates in this list which must
be less than or equal to the return from available(). |
Candidate getNextCandidate() throws OperationFailedException
Candidate
in this list. Candidate
in this list. The
hasNext()
method should be used to test that a next
Candidate
is available before calling this
method.IllegalStateException
- no more elements available in
this listOperationFailedException
- unable to complete requestmandatory
- This method must be implemented. Candidate[] getNextCandidates(long n) throws OperationFailedException
Candidates
in this list which must
be less than or equal to the return from available().
n
- the number of Candidate
elements requested
which must be less than or equal to available()
Candidate
elements.
The length of the array is less than or equal to the number
specified.IllegalStateException
- no more elements available in
this listOperationFailedException
- unable to complete requestmandatory
- This method must be implemented.