shadow:standard

Interface IteratorNullable<T>

interface IteratorNullable<T>

Interface IteratorNullable<T> allows each item in a collection to be visited. It is expected that container classes that can contain null value will have an inner class with this interface. This interface differs from Iterator<T> in that the values it retrieves may sometimes be null.

See Also

Method Summary

Modifiers Return Types Method and Description
public readonly (boolean) hasNext()

Method to check if there is another value that the iterator has not yet visited in the collection.

public (nullable T) next()

Method to move the iterator forward and retrieve the next value in the collection, which might be null.

Method Detail

hasNext

public readonly hasNext() => (boolean)

Method to check if there is another value that the iterator has not yet visited in the collection.

Returns

true if there is another value to visit

next

public next() => (nullable T)

Method to move the iterator forward and retrieve the next value in the collection, which might be null. Implementations are expected to throw a NoSuchElementException if there are no more values.

Returns

next value

See Also