Class ArrayResettableIterator<E>
- java.lang.Object
-
- org.apache.activemq.artemis.utils.collections.ArrayResettableIterator<E>
-
- Type Parameters:
E-
- All Implemented Interfaces:
Iterator<E>,ResettableIterator<E>
public class ArrayResettableIterator<E> extends Object implements ResettableIterator<E>
Provides an Array Iterator that is able to reset, allowing you to iterate over the full array. It achieves this though by moving end position mark to the the current cursors position, so it round robins, even with reset.
-
-
Constructor Summary
Constructors Constructor Description ArrayResettableIterator(Object[] array)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()static <E> ResettableIterator<E>iterator(Collection<E> collection)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, remove
-
-
-
-
Constructor Detail
-
ArrayResettableIterator
public ArrayResettableIterator(Object[] array)
-
-
Method Detail
-
iterator
public static <E> ResettableIterator<E> iterator(Collection<E> collection)
-
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>
-
-