Class Matched<X,​Y>

  • Type Parameters:
    X - Type of item in first iterator.
    Y - Type of item in second iterator.
    All Implemented Interfaces:
    Iterator<X>

    public final class Matched<X,​Y>
    extends Object
    implements Iterator<X>
    Matched iterator. Iterates over 2 iterators at the same time and verify that elements with the same position has correlation by the function. The function might be equals, endsWith, greaterThen, nonNull, empty, negative, positive, etc.
    Since:
    0.47
    • Constructor Detail

      • Matched

        public Matched​(BiFunc<? super X,​? super Y,​Boolean> fnc,
                       Iterator<? extends X> fst,
                       Iterator<? extends Y> snd)
        Ctor.
        Parameters:
        fnc - The function to detect the correlation between elements.
        fst - The first part of duplex iterator.
        snd - The second part of duplex iterator.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<X>
      • next

        public X next()
        Specified by:
        next in interface Iterator<X>