Class Diff<Left,​Right>

  • All Implemented Interfaces:
    java.lang.Iterable<Pair<Optional<Left>,​Optional<Right>>>

    public final class Diff<Left,​Right>
    extends java.lang.Object
    implements java.lang.Iterable<Pair<Optional<Left>,​Optional<Right>>>
    An Iterable of the differences of two given Iterables.

    Note, to get correct results, the Iterables must be sorted by the comparison criterion.

    Example

    
     Diff([1,3,5,7], [3,4,5], Integer::compareTo) ->
     [
       (1, -),
       (3, 3),
       (-, 4),
       (5, 5),
       (7, -)
     ]
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Diff​(java.lang.Iterable<Left> lefts, java.lang.Iterable<Right> rights, BiFunction<? super Left,​? super Right,​java.lang.Integer> comparatorFunction)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<Pair<Optional<Left>,​Optional<Right>>> 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

      • Diff

        public Diff​(java.lang.Iterable<Left> lefts,
                    java.lang.Iterable<Right> rights,
                    BiFunction<? super Left,​? super Right,​java.lang.Integer> comparatorFunction)