- All Implemented Interfaces:
- Iterator<OutType>
public class SortedMergeIterator<InType,OutType>
extends Object
implements Iterator<OutType>
A SortedMergeIterator is an Iterator that combines two other Iterators into one.
It assumes that the two Iterators are in sorted order and walks through them, passing their values to the
BinaryFn in sorted order. If a value appears in one Iterator and not in the other, e.g. if the lhs has a value "1"
and the rhs does not, the BinaryFn will be called with "1" for first argument and null for the second argument.
Thus, the BinaryFn implementation *must* be aware of nulls.