Reference/Utility Classes/AbstractIterator¶
A generic iterator very similar to the pattern used in Java.
Class Signature¶
Description
A generic iterator very similar to the pattern used in Java.
Generic Arguments
- E [any] The type of element which will be returned during iteration over this object.
Initial Version v0.1.0
Latest Version v1.5.0
1 | |
Inheritance¶
Direct:
- none
Indirect:
- none
Direct:
ArrayIterator: Add tagline.AsyncIterator: Add tagline.EmptyIterator: Add tagline.ObjectIterator: Add tagline.StringCharacterIterator: Add tagline.StringLineIterator: Add tagline.
Indirect:
- none
Abstract 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().
Implements IIterator#hasNext
1 | |
#next¶
Description
Returns the next element this AbstractIterator has to iterate over.
Returns [E] The next element this AbstractIterator has.
Implements IIterator#next
1 | |
Concrete Instance Method Signatures¶
#forEachRemaining¶
Description
Performs the specified action for all of the remaining elements in this AbstractIterator.
Parameters
- callback [(element: E) => void] The action to perform on the remaining elements of this
AbstractIterator.
Implements IIterator#forEachRemaining
1 | |
#remove¶
Description
Removes and returns the last element returned by the next() method from the underlying data structure.
Returns [E | undefined] The last element returned by the next() method.
Implements IIterator#remove
1 | |
#reset¶
Description
Resets this AbstractIterator back to it's initial position, readying it to iterate over the underlying collection from
the 'beginning' again.
Implements IIterator#reset
1 | |
#[Symbol.iterator]¶
Implements IIterator#[Symbol.iterator]
1 | |
#getIterableIterator¶
Implements IIterator#getIterableIterator
1 | |