Package xyz.cofe.iter

Class BiProductIterator<A,​B>

java.lang.Object
xyz.cofe.iter.BiProductIterator<A,​B>
Type Parameters:
A - Тип первого списка
B - Тип второго списка
All Implemented Interfaces:
java.util.Iterator<Pair<A,​B>>

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

    Fields 
    Modifier and Type Field Description
    protected A _1cur  
    protected java.util.Iterator<A> _1it  
    protected java.util.Iterator<B> _2it  
    protected java.lang.Iterable<B> _2src  
    protected Pair<A,​B> fetched  
  • Constructor Summary

    Constructors 
    Constructor Description
    BiProductIterator​(java.lang.Iterable<A> _1, java.lang.Iterable<B> _2)
    Конструктор
    BiProductIterator​(java.util.Iterator<A> _1, java.lang.Iterable<B> _2)
    Конструктор
  • Method Summary

    Modifier and Type Method Description
    protected Pair<A,​B> fetch()  
    protected void finish()  
    boolean hasNext()  
    Pair<A,​B> next()  
    protected Pair<B,​java.lang.Boolean> nextB()  
    protected boolean switchNextA()  

    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, remove
  • Field Details

    • _1it

      protected java.util.Iterator<A> _1it
    • _2src

      protected java.lang.Iterable<B> _2src
    • _1cur

      protected A _1cur
    • _2it

      protected java.util.Iterator<B> _2it
    • fetched

      protected Pair<A,​B> fetched
  • Constructor Details

    • BiProductIterator

      public BiProductIterator​(java.util.Iterator<A> _1, java.lang.Iterable<B> _2)
      Конструктор
      Parameters:
      _1 - Первый список
      _2 - Второй список
    • BiProductIterator

      public BiProductIterator​(java.lang.Iterable<A> _1, java.lang.Iterable<B> _2)
      Конструктор
      Parameters:
      _1 - Первый список
      _2 - Второй список
  • Method Details

    • finish

      protected void finish()
    • switchNextA

      protected boolean switchNextA()
    • nextB

      protected Pair<B,​java.lang.Boolean> nextB()
    • hasNext

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

      protected Pair<A,​B> fetch()
    • next

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