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

Change IteratorChain to use a Queue and remove iterators after use

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-alpha1, 4.0
    • Component/s: Iterator
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: