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.

    Author:
    Curtis Rueden, Ellen T Arena
    • 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
    • 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>