OsidList Pattern

The typed iterator for a domain — extend to deliver objects one at a time from any source.

Overview

An OsidList is a forward-only iterator over a typed sequence of domain objects. It exposes hasNext(), available() (a best-effort count), and getNext[OsidObject](). The abstract base handles the iteration contract; extend it and override getNext[OsidObject]() to pull the next object from whatever source backs the list — an array, a result set, or a lazy stream.

For most cases, prefer one of the concrete list implementations (Array, Linked, Single, Iterator, Error, Mutable) over extending the abstract base directly.

Javadoc Reference

net.okapia.osid.jamocha.spi

Class Declaration Pattern

public abstract class AbstractOsidObjectList
extends AbstractOsidList
implements OsidObjectList

Constructor Pattern

AbstractOsidObjectList()

No parameters. Subclasses initialize the backing source in their own constructors and advance it via getNext[OsidObject]().

Key Override Pattern

public OsidObject getNextOsidObject() throws NotFoundException, OperationFailedException
public OsidObject[] getNextOsidObjects(long n) throws NotFoundException, OperationFailedException