public interface OsidList extends OsidList, java.io.Closeable
OsidList
is the top-level interface for all OSID lists.
An OSID list provides sequential access, one at a time or many at a time,
access to a set of elements. These elements are not required to be
OsidObjects but generally are. The element retrieval methods are defined
in the sub-interface of OsidList
where the appropriate
return type is defined.
Osid lists are a once pass through iteration of elements. The size of the object set and the means in which the element set is generated or stored is not known. Assumptions based on the length of the element set by copying the entire contents of the list into a fixed buffer should be done with caution a awareness that an implementation may return a number of elements ranging from zero to infinity.
Lists are returned by methods when multiple return values are possible. There is no guarantee that successive calls to the same method will return the same set of elements in a list. Unless an order is specified in an interface definition, the order of the elements is not known.
boolean hasNext()
true
if more elements are available in this
list, false
if the end of the list has been
reachedmandatory
- This method must be implemented. Any
- errors that may result from accesing the underlying set of
elements are to be deferred until the consumer attempts
retrieval in which case the provider must return true
for this method. long available()
hasNext()
should be used. This
method conveys what is known about the number of remaining elements at
a point in time and can be used to determine a minimum size of the
remaining elements, if known. A valid return is zero even if
hasNext()
is true.
This method does not imply asynchronous usage. All OSID methods may
block.mandatory
- This method must be implemented. Any
- errors that may result from accesing the underlying set of
elements are to be deferred until the consumer attempts
retrieval in which case the provider must return a positive
integer for this method so the consumer can continue execution
to receive the error. In all other circumstances, the provider
must not return a number greater than the number of elements
known since this number will be fed as a parameter to the bulk
retrieval method. void skip(long n)
n
- the number of elements to skipmandatory
- This method must be implemented.