The essential abstract methods are:
def hasNext: Boolean
def next(): ThasNext reports whether another result is available. next() returns that result and advances; if exhausted, it throws NoSuchElementException. The other ordinary iterator operations are implemented using these primitives. An availability check must not silently discard a result visible to the client, although an adapter may need to fetch and cache underlying values in order to decide availability.[ref]Scala 2.12 iterator API documentation. Iterator abstract members hasNext and next; exhaustion contract
Articles by others on the same topic
There are currently no matching articles.