Skip to content

Reference/Utility Classes/ArrayIterator

A utility class for getting a full iter-over iteration context from an otherwise primitive array.

How-To/Usage Guide

Find a how-to/usage guide for the ArrayIterator here class, or navigate to it via the 'The Basics' tab.


Class Signature

Description
A utility class for getting a full iter-over iteration context from an otherwise primitive array.

Generic Arguments
- E [any] The type of element contained in the underlying array.

Initial Version v0.1.0
Latest Version v2.1.0

1
abstract class AbstractIterator<E> implements IIterator<E | undefined>

Inheritance

Direct:

  • AbstractIterator: A generic iterator very similar to the pattern used in Java.

Indirect:

  • none

Direct:

  • IIterator: An interface representing the general form of an iterable class.

Indirect:

  • none

Direct:

  • none

Indirect:

  • none

Instance Method Signatures

#hasNext

Description
Returns true if this iterator has at least one more element that can be returned from next().

Returns [boolean] true if this iterator has at least one more element that can be returned from next().
Overrides AbstractIterator#hasNext

1
public hasNext(): boolean

#next

Description
Returns the next element of the underlying array, or undefined if there are no more elements to consume.

Returns [E | undefined] The next element of the underlying array, or undefined if there are no more elements to consume.
Overrides AbstractIterator#next

1
public next(): E | undefined

#remove

Description
Removes and returns the last element returned by the next() method from the underlying array.

Returns [E | undefined] The last element returned by the next() method.
Overrides AbstractIterator#remove

1
public remove(): E | undefined

#reset

Description
Resets this iterator back to the first element of the underlying array.

Overrides AbstractIterator#reset

1
public reset(): void