Class CollectionsPlume.MergedIterator<T>

java.lang.Object
org.plumelib.util.CollectionsPlume.MergedIterator<T>
Type Parameters:
T - the type of elements of the iterator
All Implemented Interfaces:
Iterator<T>
Enclosing class:
CollectionsPlume

public static final class CollectionsPlume.MergedIterator<T> extends Object implements Iterator<T>
An Iterator that returns the elements in each of its argument Iterators, in turn. The argument is an Iterator of Iterators. Like CollectionsPlume.MergedIterator2, but generalized to arbitrary number of iterators.
  • Constructor Details

    • MergedIterator

      public MergedIterator(Iterator<Iterator<T>> itorOfItors)
      Create an iterator that returns the elements of the given iterators, in turn.
      Parameters:
      itorOfItors - an iterator whose elements are iterators; this MergedIterator will merge them all
  • Method Details

    • hasNext

      public boolean hasNext(@GuardSatisfied CollectionsPlume.MergedIterator<T> this)
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next(@GuardSatisfied CollectionsPlume.MergedIterator<T> this)
      Specified by:
      next in interface Iterator<T>
    • remove

      public void remove(@GuardSatisfied CollectionsPlume.MergedIterator<T> this)
      Specified by:
      remove in interface Iterator<T>