Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-460

Change IteratorChain to use a Queue and remove iterators after use

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-alpha1, 4.0
    • Iterator
    • None

    Description

      An IteratorQueue is equivalent to an IteratorChain with the difference that the iterators to use are put into a queue instead of an list, and that they are removed from the queue if an iterator is exhausted.

      The IteratorChain keeps the iterators in the list even if they are exhausted, thus they can not be gc'ed until the whole chain is done. The interface of IteratorChain also contains a getIterators method, which returns the list of iterators used by this chain. So instead of changing the IteratorChain, I propose to add a separate class IteratorQueue with the described behavior.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tn Thomas Neidhart
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: