Class Diff<Left,Right>

java.lang.Object
org.dmfs.jems2.iterable.Diff<Left,Right>
All Implemented Interfaces:
Iterable<Pair<Optional<Left>,Optional<Right>>>

public final class Diff<Left,Right> extends Object implements 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, -)
 ]