Class EditingIterator<T>
java.lang.Object
com.github.tommyettinger.ds.support.util.EditingIterator<T>
- Type Parameters:
T- the type of items this can return, and the type the wrapped Iterator returns
- All Implemented Interfaces:
Iterator<T>
Wraps an Iterator so that it calls a function on each item it would otherwise return, and returns that function's
result.
If you need to return a different type than what the iterator returns, you can use an
You can change both the Iterator and editor at once using
AlteringIterator.
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, ObjToSameFunction), and can also
just change the Iterator with set(Iterator).-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEditingIterator(Iterator<T> iterator, com.github.tommyettinger.function.ObjToSameFunction<T> 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
-
EditingIterator
public EditingIterator() -
EditingIterator
-
-
Method Details