public interface TermList extends OsidList
Like all OsidLists,
TermList
provides a
means for accessing Term
elements sequentially either one
at a time or many at a time. Examples:
while (tl.hasNext()) { Term term = tl.getNextTerm(); }or
while (tl.hasNext()) { Term[] terms = tl.getNextTerms(tl.available()); }
Modifier and Type | Method and Description |
---|---|
Term |
getNextTerm()
Gets the next
Term in this list. |
Term[] |
getNextTerms(long n)
Gets the next set of
Term elements in this list. |
Term getNextTerm() throws OperationFailedException
Term
in this list. Term
in this list. The
hasNext()
method should be used to test that a next
Term
is available before calling this method.IllegalStateException
- no more elements available in
this listOperationFailedException
- unable to complete requestmandatory
- This method must be implemented. Term[] getNextTerms(long n) throws OperationFailedException
Term
elements in this list. The
specified amount must be less than or equal to the return from
available().
n
- the number of Term
elements requested which
must be less than or equal to available()
Term
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.