Class AlteringIterator<T,R>
java.lang.Object
com.github.tommyettinger.ds.support.util.AlteringIterator<T,R>
- Type Parameters:
T- the type of items this can return, and the type the wrapped Iterator returns
- All Implemented Interfaces:
Iterator<R>
Wraps an Iterator so that it calls a function on each item it would otherwise return, and returns that function's
result. That means this is just like
You can change both the Iterator and editor at once using
EditingIterator, except this may return a different type than what the
iterator returns.
This has undefined behavior if any items the Iterator could return are modified during iteration.
You can change both the Iterator and editor at once using
set(Iterator, ObjToObjFunction), and can also
just change the Iterator with set(Iterator).-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAlteringIterator(Iterator<T> iterator, com.github.tommyettinger.function.ObjToObjFunction<T, R> editor) -
Method Summary
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
-
Field Details
-
iterator
-
editor
-
-
Constructor Details
-
AlteringIterator
public AlteringIterator() -
AlteringIterator
-
-
Method Details