Interface GridIterator<T>
-
- All Superinterfaces:
GridSerializableIterator<T>,Iterable<T>,Iterator<T>,Serializable
- All Known Subinterfaces:
CacheWeakQueryIteratorsHolder.WeakReferenceCloseableIterator<T>,GridCloseableIterator<T>,GridIterable<T>,IgniteHistoricalIterator,IgniteRebalanceIterator,WALIterator
- All Known Implementing Classes:
AbstractScanQueryIterator,AbstractWalRecordsIterator,CacheQueryReducer,CacheWeakQueryIteratorsHolder.WeakQueryCloseableIterator,FilteredWalIterator,FlatIterator,GridCloseableIteratorAdapter,GridCloseableIteratorAdapterEx,GridEmptyCloseableIterator,GridEmptyIterator,GridIterableAdapter,GridIterableAdapter.IteratorWrapper,GridIteratorAdapter,GridSpiCloseableIteratorWrapper,IgniteRebalanceIteratorImpl,IgniteSingletonIterator,IndexQueryReducer,ScanQueryIterator,SingleSegmentLogicalRecordsIterator,TextQueryReducer,TransformFilteringIterator,UnsortedCacheQueryReducer
public interface GridIterator<T> extends Iterable<T>, GridSerializableIterator<T>
Defines "rich" iterator interface that is also acts like lambda function and iterable.- See Also:
GridIterable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanhasNextX()This method is the same asIterator.hasNext(), but allows for failure with exception.TnextX()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, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
-
-
-
Method Detail
-
hasNextX
boolean hasNextX() throws IgniteCheckedExceptionThis 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:
Iterator.hasNext()
-
nextX
T nextX() throws IgniteCheckedException
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:
Iterator.next()
-
removeX
void removeX() throws IgniteCheckedExceptionThis method is the same asIterator.remove(), but allows for failure with exception.- Throws:
IgniteCheckedException- If failed.
-
-