Class SmartIterator.Wrapper<E extends @NonNull Object>

java.lang.Object
dev.sympho.modular_commands.utils.SmartIterator.Wrapper<E>
Type Parameters:
E - The element type.
All Implemented Interfaces:
SmartIterator<E>, Iterator<E>
Direct Known Subclasses:
SmartIterator.ListIterator
Enclosing interface:
SmartIterator<E extends @NonNull Object>

public static class SmartIterator.Wrapper<E extends @NonNull Object> extends Object implements SmartIterator<E>
A smart iterator that wraps an existing iterator.

Note that, in order to support peek() functionality, the wrapper always prefetches the next element. This may cause issues with iterators whose next() method has side effects that are timing-sensitive.

Note also that, naturally, it only tolerates concurrent modifications to the original data source during iteration if the backing iterator does so.

Since:
1.0