IndexTrackingIterator
A generic iterator that tracks the index of the current element.
This iterator wraps a standard ListIterator and maintains the index of the most recently read element, which can be accessed via currentIndex.
This class provides a generic implementation that can be used with any type of list elements. It correctly handles bidirectional iteration by tracking the current index internally.
This iterator is particularly useful for operations that need to know the position of elements during iteration, such as calculating correspondences between lists or tracking modifications.
Since
3.28.0
Parameters
<T>
the type of elements in the list
Constructors
Functions
Link copied to clipboard
Returns the index of the element that was returned by the most recent call to next or previous.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard