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:
java.util.Iterator<E>,ResettableIterator<E>
public class MultiResettableIterator<E> extends java.lang.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.
-
-
-
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>
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<E>
-
next
public E next()
- Specified by:
nextin interfacejava.util.Iterator<E>
-
get
protected I get(int index)
-
-