Class CollectionsPlume.MergedIterator2<T>

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

public static final class CollectionsPlume.MergedIterator2<T> extends Object implements Iterator<T>
An Iterator that returns first the elements returned by its first argument, then the elements returned by its second argument. Like CollectionsPlume.MergedIterator, but specialized for the case of two arguments.
  • Constructor Details

    • MergedIterator2

      public MergedIterator2(Iterator<T> itor1, Iterator<T> itor2)
      Create an iterator that returns the elements of itor1 then those of itor2.
      Parameters:
      itor1 - an Iterator
      itor2 - another Iterator
  • Method Details

    • hasNext

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

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

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