Package com.atlassian.bamboo.utils
Class MemorisingIterable.MemorisingIterator<T>
- java.lang.Object
-
- com.atlassian.bamboo.utils.MemorisingIterable.MemorisingIterator<T>
-
- Type Parameters:
T- type of elements returned by this iterator
- All Implemented Interfaces:
Iterator<T>
- Enclosing class:
- MemorisingIterable<T>
public static class MemorisingIterable.MemorisingIterator<T> extends Object implements Iterator<T>
Iterator which memorises all traversed elements.
-
-
Constructor Summary
Constructors Constructor Description MemorisingIterator(@NotNull Iterator<T> iterator)Creates new instance ofMemorisingIterable.MemorisingIteratorbacked by the giveniterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<T>getTraversedElements()Returns a list of all elements already traversed by callingIterator.next()on this object.booleanhasNext()Tnext()-
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
-
MemorisingIterator
public MemorisingIterator(@NotNull @NotNull Iterator<T> iterator)Creates new instance ofMemorisingIterable.MemorisingIteratorbacked by the giveniterator.
-
-
Method Detail
-
getTraversedElements
@NotNull public @NotNull List<T> getTraversedElements()
Returns a list of all elements already traversed by callingIterator.next()on this object.
-
-