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

New LazyIteratorChain class.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-alpha1, 4.0
    • Component/s: Iterator
    • Labels:
    • Environment:

      Java 1.5 or greater

      Description

      I would like to submit my DynamicIterator class for inclusion in Commons Collections.

      Description from JavaDoc:

      Iterates over the elements of an inner iterator provided by nextIterator() Once the inner iterator's hasNext() method returns false, nextIterator() will be called to obtain another iterator, and so on until nextIterator() returns null.

      The use case I had in mind for this class was the paged web service. A web service returns a list of results, which are paginated. Once a page's results are exhausted, nextIterator() can go fetch the next page for iteration.

      This class, and accompanying test class are my original works. I have released them into the public domain, feel free to use the appropriate ASF license.

        Attachments

        1. LazyIteratorChain.java
          4 kB
          Jeff Rodriguez
        2. LazyIteratorChainTest.java
          4 kB
          Jeff Rodriguez

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jeffrey.rodriguez Jeff Rodriguez
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified