Iterator
Defined in: src/interfaces/Iterator.ts:6
A cursor over a collection (hasNext/next/remove). Distinct from the JS iterator protocol, which collections
also implement. Iterators returned by the library’s collections are fail-fast: after a structural change made
other than through this iterator, the next step throws ConcurrentModificationException.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”E
Methods
Section titled “Methods”forEachRemaining()
Section titled “forEachRemaining()”forEachRemaining(
action):void
Defined in: src/interfaces/Iterator.ts:30
Calls action for each remaining element, in order, until the iterator is exhausted.
Parameters
Section titled “Parameters”action
Section titled “action”(e) => void
Returns
Section titled “Returns”void
Throws
Section titled “Throws”NullPointerException if action is null
hasNext()
Section titled “hasNext()”hasNext():
boolean
Defined in: src/interfaces/Iterator.ts:8
Returns true if next() would return an element.
Returns
Section titled “Returns”boolean
next()
Section titled “next()”next():
E
Defined in: src/interfaces/Iterator.ts:15
Returns the next element and advances the cursor.
Returns
Section titled “Returns”E
Throws
Section titled “Throws”NoSuchElementException if there are no more elements
Throws
Section titled “Throws”ConcurrentModificationException if the collection was structurally modified other than through this iterator
remove()
Section titled “remove()”remove():
void
Defined in: src/interfaces/Iterator.ts:25
Removes the element last returned by next() from the underlying collection.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”IllegalStateException if next() has not been called, or remove() was already called after the
last next()
Throws
Section titled “Throws”UnsupportedOperationException if the collection is unmodifiable or the iterator does not support removal
Throws
Section titled “Throws”ConcurrentModificationException if the collection was structurally modified other than through this iterator