Class ListIteratorWrapper

  • All Implemented Interfaces:
    Iterator, ListIterator, ResettableIterator, ResettableListIterator

    public class ListIteratorWrapper
    extends Object
    implements ResettableListIterator
    Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.
    Converts an iterator into a list iterator by caching the returned entries.

    The ListIterator interface has additional useful methods for navigation - previous() and the index methods. This class allows a regular Iterator to behave as a ListIterator. It achieves this by building a list internally of as the underlying iterator is traversed.

    The optional operations of ListIterator are not supported.

    This class implements ResettableListIterator from Commons Collections 3.2.

    Commons Collections 2.1