- Type Parameters:
E- The element type.
- All Implemented Interfaces:
SmartIterator<E>,SmartIterator.Detachable<E>,Iterator<E>
- Enclosing interface:
- SmartIterator<E extends @NonNull Object>
This class relies on SmartIterator.Wrapper with an iterator provided by the list for most
of its operations, and thus has the same caveats; it only has changes necessary for
supporting the SmartIterator.Detachable interface.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.sympho.modular_commands.utils.SmartIterator
SmartIterator.Detachable<E extends @NonNull Object>, SmartIterator.ListIterator<E extends @NonNull Object>, SmartIterator.Wrapper<E extends @NonNull Object> -
Field Summary
Fields inherited from interface dev.sympho.modular_commands.utils.SmartIterator
NO_MORE_ELEMENTS_ERROR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnext()Returns a list view over the portion of the list that has not been iterated over yet.toFlux()Returns a flux that issues the remaining elements to be traversed by this iterator.Returns an iterator that iterates over the remaining elements to be traversed by this iterator.Returns a spliterator that iterates over the remaining elements to be traversed by this iterator.toStream()Returns a stream that contains over the remaining elements to be traversed by this iterator.Methods inherited from class dev.sympho.modular_commands.utils.SmartIterator.Wrapper
peekMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, removeMethods inherited from interface dev.sympho.modular_commands.utils.SmartIterator
hasNext, peek
-
Constructor Details
-
ListIterator
Creates a new instance.- Parameters:
list- The list to iterate over.
-
-
Method Details
-
remaining
Returns a list view over the portion of the list that has not been iterated over yet.- Returns:
- The remaining items as a list.
-
next
-
toIterator
Description copied from interface:SmartIterator.DetachableReturns an iterator that iterates over the remaining elements to be traversed by this iterator.The returned iterator is guaranteed to be detached from this iterator. In other words, they are completely independent of each other and may both be used separately.
- Specified by:
toIteratorin interfaceSmartIterator.Detachable<E extends @NonNull Object>- Returns:
- The iterator.
-
toSpliterator
Description copied from interface:SmartIterator.DetachableReturns a spliterator that iterates over the remaining elements to be traversed by this iterator.The returned spliterator is guaranteed to be detached from this iterator. In other words, they are completely independent of each other and may both be used separately.
- Specified by:
toSpliteratorin interfaceSmartIterator<E extends @NonNull Object>- Specified by:
toSpliteratorin interfaceSmartIterator.Detachable<E extends @NonNull Object>- Returns:
- The spliterator.
-
toStream
Description copied from interface:SmartIterator.DetachableReturns a stream that contains over the remaining elements to be traversed by this iterator.The returned stream is guaranteed to be detached from this iterator. In other words, they are completely independent of each other and may both be used separately.
- Specified by:
toStreamin interfaceSmartIterator<E extends @NonNull Object>- Specified by:
toStreamin interfaceSmartIterator.Detachable<E extends @NonNull Object>- Returns:
- The stream.
-
toFlux
Description copied from interface:SmartIterator.DetachableReturns a flux that issues the remaining elements to be traversed by this iterator.The returned flux is guaranteed to be detached from this iterator. In other words, they are completely independent of each other and may both be used separately.
- Specified by:
toFluxin interfaceSmartIterator<E extends @NonNull Object>- Specified by:
toFluxin interfaceSmartIterator.Detachable<E extends @NonNull Object>- Returns:
- The flux.
-