Class IterablePair<A,​B>

  • Type Parameters:
    A -
    B -
    All Implemented Interfaces:
    java.lang.Iterable<Pair<A,​B>>

    public class IterablePair<A,​B>
    extends java.lang.Object
    implements java.lang.Iterable<Pair<A,​B>>
    An Iterable which is backed by two other Iterables, whose iteration produces a Pair of objects corresponding to those given by the two respective iterations of the backing Iterables. That is: the two backing Iterables are iterated in synchrony, and their elements combined into a single Pair accessor object.

    When two Iterables are given which produce an unequal number of elements, the iteration of the IterablePair ends when either of the two backing iterations ends.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Iterable<A> iter1  
      private java.lang.Iterable<B> iter2  
    • Constructor Summary

      Constructors 
      Constructor Description
      IterablePair​(java.lang.Iterable<A> iter1, java.lang.Iterable<B> iter2)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<Pair<A,​B>> iterator()  
      • Methods inherited from class java.lang.Object

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

        forEach, spliterator
    • Field Detail

      • iter1

        private final java.lang.Iterable<A> iter1
      • iter2

        private final java.lang.Iterable<B> iter2
    • Constructor Detail

      • IterablePair

        public IterablePair​(java.lang.Iterable<A> iter1,
                            java.lang.Iterable<B> iter2)
    • Method Detail

      • iterator

        public java.util.Iterator<Pair<A,​B>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<A>