Class GridIterableAdapter.IteratorWrapper<T>
- java.lang.Object
-
- org.apache.ignite.internal.util.lang.GridIteratorAdapter<T>
-
- org.apache.ignite.internal.util.lang.GridIterableAdapter.IteratorWrapper<T>
-
- All Implemented Interfaces:
Serializable,Iterable<T>,Iterator<T>,GridSerializableIterator<T>,GridIterator<T>
- Enclosing class:
- GridIterableAdapter<T>
public static class GridIterableAdapter.IteratorWrapper<T> extends GridIteratorAdapter<T>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IteratorWrapper(Iterator<T> it)Creates wrapper around the iterator.
-
Method Summary
All Methods Instance Methods Concrete 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 class org.apache.ignite.internal.util.lang.GridIteratorAdapter
hasNext, iterator, next, remove
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Method Detail
-
hasNextX
public 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
public 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:
IgniteCheckedException- If no more elements can be returned due to some failure, like a network error for example.- See Also:
Iterator.next()
-
removeX
public void removeX() throws IgniteCheckedExceptionThis method is the same asIterator.remove(), but allows for failure with exception.- Throws:
IgniteCheckedException- If failed.
-
-