Class ArrayResettableIterator<E>
java.lang.Object
org.apache.activemq.artemis.utils.collections.ArrayResettableIterator<E>
- All Implemented Interfaces:
Iterator<E>,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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()static <E> ResettableIterator<E>iterator(Collection<E> collection) next()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, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
ArrayResettableIterator
-
-
Method Details
-
iterator
-
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() -
next
-