Array OsidList Pattern

An OsidList backed by an array — all elements loaded at construction time, fast to iterate.

Overview

The array-backed OsidList loads all elements into an internal array at construction time. It is the simplest and most predictable implementation: available() returns an exact count, iteration is O(1) per element, and there are no I/O exceptions possible once constructed.

Use the array list when you have all results in memory and want to wrap them in an OsidList interface without buffering overhead.

Javadoc Reference

net.okapia.osid.jamocha.spi

Class Declaration Pattern

public final class ArrayOsidObjectList
extends Object
implements OsidObjectList

Constructor Pattern

ArrayOsidObjectList(OsidObject[] elements)
ParameterTypeDescription
elements OsidObject[] the elements to expose through the OsidList interface

Static Factory Method Pattern

static OsidObjectList of(OsidObject... elements)
ParameterTypeDescription
elements OsidObject... vararg elements

Returns OsidObjectList