Class Pair.ZipIterator<L,​R>

  • Type Parameters:
    L - Left-hand type
    R - Right-hand type
    All Implemented Interfaces:
    java.util.Iterator<Pair<L,​R>>
    Enclosing class:
    Pair<T1,​T2>

    private static class Pair.ZipIterator<L,​R>
    extends java.lang.Object
    implements java.util.Iterator<Pair<L,​R>>
    Iterator that pairs elements from two iterators.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Iterator<? extends L> leftIterator  
      private java.util.Iterator<? extends R> rightIterator  
    • Constructor Summary

      Constructors 
      Constructor Description
      ZipIterator​(java.util.Iterator<? extends L> leftIterator, java.util.Iterator<? extends R> rightIterator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()  
      Pair<L,​R> next()  
      void remove()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • leftIterator

        private final java.util.Iterator<? extends L> leftIterator
      • rightIterator

        private final java.util.Iterator<? extends R> rightIterator
    • Constructor Detail

      • ZipIterator

        ZipIterator​(java.util.Iterator<? extends L> leftIterator,
                    java.util.Iterator<? extends R> rightIterator)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<L>
      • next

        public Pair<L,​R> next()
        Specified by:
        next in interface java.util.Iterator<L>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<L>