Package xyz.cofe.iter

Class BiProductIterable<A,​B>

java.lang.Object
xyz.cofe.iter.BiProductIterable<A,​B>
Type Parameters:
A - Тип первого значения в паре
B - Тип воторого значения в паре
All Implemented Interfaces:
java.lang.Iterable<Pair<A,​B>>, Eterable<Pair<A,​B>>

public class BiProductIterable<A,​B>
extends java.lang.Object
implements Eterable<Pair<A,​B>>
Итератор - декартово произведение
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Iterator<A> _1  
    protected java.lang.Iterable<B> _2  
  • Constructor Summary

    Constructors 
    Constructor Description
    BiProductIterable()  
  • Method Summary

    Modifier and Type Method Description
    java.util.Iterator<Pair<A,​B>> iterator()  
    static <A,​ B> BiProductIterable<A,​B> of​(java.lang.Iterable<A> _1, java.lang.Iterable<B> _2)
    Конструктор
    static <A,​ B> BiProductIterable<A,​B> of​(java.util.Iterator<A> _1, java.lang.Iterable<B> _2)
    Конструктор

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface xyz.cofe.iter.Eterable

    count, filter, first, limit, map, notNull, product, product, product, product, product, reduce, toList, union, union

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

    • _1

      protected java.util.Iterator<A> _1
    • _2

      protected java.lang.Iterable<B> _2
  • Constructor Details

  • Method Details

    • of

      public static <A,​ B> BiProductIterable<A,​B> of​(java.util.Iterator<A> _1, java.lang.Iterable<B> _2)
      Конструктор
      Type Parameters:
      A - Тип первого списка
      B - Тип второго списка
      Parameters:
      _1 - Итератор по первому списку
      _2 - Итератор по второму списку
      Returns:
      Итератор по декртовому произведению
    • of

      public static <A,​ B> BiProductIterable<A,​B> of​(java.lang.Iterable<A> _1, java.lang.Iterable<B> _2)
      Конструктор
      Type Parameters:
      A - Тип первого списка
      B - Тип второго списка
      Parameters:
      _1 - Итератор по первому списку
      _2 - Итератор по второму списку
      Returns:
      Итератор по декртовому произведению
    • iterator

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