Class MultiResettableIterator<E>
- java.lang.Object
-
- org.apache.activemq.artemis.utils.collections.MultiResettableIterator<E>
-
- Type Parameters:
E- type of the class of the iterator.
- All Implemented Interfaces:
Iterator<E>,ResettableIterator<E>
public class MultiResettableIterator<E> extends Object implements ResettableIterator<E>
Extends MultiIterator, adding the ability if the underlying iterators are resettable, then its self can reset. It achieves this by going back to the first iterator, and as moves to another iterator it resets it.
-
-
Constructor Summary
Constructors Constructor Description MultiResettableIterator(ResettableIterator<E>[] iterators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iget(int index)booleanhasNext()protected voidmoveTo(int index)Enext()voidreset()Resets the iterator so that you can iterate over all elements from your current position.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
-
-
-
Constructor Detail
-
MultiResettableIterator
public MultiResettableIterator(ResettableIterator<E>[] iterators)
-
-
Method Detail
-
moveTo
protected void moveTo(int index)
-
reset
public void reset()
Description copied from interface:ResettableIteratorResets the iterator so that you can iterate over all elements from your current position. Your current position (when reached again) signals the end of iteration as if the collection is circular.- Specified by:
resetin interfaceResettableIterator<E>
-
get
protected I get(int index)
-
-