Class TransformFilteringIterator<T2,T1>
- java.lang.Object
-
- org.apache.ignite.internal.util.lang.GridIteratorAdapter<T2>
-
- org.apache.ignite.internal.util.lang.gridfunc.TransformFilteringIterator<T2,T1>
-
- All Implemented Interfaces:
Serializable,Iterable<T2>,Iterator<T2>,GridSerializableIterator<T2>,GridIterator<T2>
public class TransformFilteringIterator<T2,T1> extends GridIteratorAdapter<T2>
Iterator from given iter and optional filtering predicate.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TransformFilteringIterator(Iterator<? extends T1> iter, IgniteClosure<? super T1,T2> clos, boolean readOnly, IgnitePredicate<? super T1>... preds)
-
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.T2nextX()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.StringtoString()-
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, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
TransformFilteringIterator
public TransformFilteringIterator(Iterator<? extends T1> iter, IgniteClosure<? super T1,T2> clos, boolean readOnly, IgnitePredicate<? super T1>... preds)
- Parameters:
iter- Input iter.clos- Transforming closure to convert from T1 to T2.readOnly- Iftrue, then resulting iter will not allow modifications to the underlying collection.preds- Optional filtering predicates.
-
-
Method Detail
-
hasNextX
public boolean 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.- See Also:
Iterator.hasNext()
-
nextX
@Nullable public T2 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.- See Also:
Iterator.next()
-
removeX
public void removeX()
This method is the same asIterator.remove(), but allows for failure with exception.
-
-