Interface GridIterator<T>
- All Superinterfaces:
GridSerializableIterator<T>,Iterable<T>,Iterator<T>,Serializable
- All Known Implementing Classes:
GridEmptyIterator,GridIteratorAdapter,TransformFilteringIterator
Defines "rich" iterator interface that is also acts like lambda function and iterable.
- See Also:
-
GridIterable
-
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNextX()This method is the same asIterator.hasNext(), but allows for failure with exception.nextX()This method is the same asIterator.next(), but allows for failure with exception.voidremoveX()This method is the same asIterator.remove(), but allows for failure with exception.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
hasNextX
This method is the same asIterator.hasNext(), but allows for failure with exception. Often iterators are used to iterate through values that have not or have partially been received from remote nodes, and need to account for possible network failures, rather than just returningfalseout ofIterator.hasNext()method.- Returns:
Trueif iterator contains more elements.- Throws:
IgniteCheckedException- If no more elements can be returned due to some failure, like a network error for example.- See Also:
-
nextX
This method is the same asIterator.next(), but allows for failure with exception. Often iterators are used to iterate through values that have not or have partially been received from remote nodes, and need to account for possible network failures, rather than throwingNoSuchElementExceptionruntime exception.s- Returns:
Trueif iterator contains more elements.- Throws:
NoSuchElementException- If there are no more elements to return.IgniteCheckedException- If no more elements can be returned due to some failure, like a network error for example.- See Also:
-
removeX
This method is the same asIterator.remove(), but allows for failure with exception.- Throws:
IgniteCheckedException- If failed.
-