Class OverlappingObjectIterator<L,R>

java.lang.Object
generic.util.AbstractPeekableIterator<org.apache.commons.lang3.tuple.Pair<L,R>>
ghidra.trace.util.OverlappingObjectIterator<L,R>
Type Parameters:
L - the type of objects returned by the left iterator
R - the type of objects returned by the right iterator
All Implemented Interfaces:
PeekableIterator<org.apache.commons.lang3.tuple.Pair<L,R>>, Iterator<org.apache.commons.lang3.tuple.Pair<L,R>>

public class OverlappingObjectIterator<L,R> extends AbstractPeekableIterator<org.apache.commons.lang3.tuple.Pair<L,R>>
An iterator of overlapping objects return from two given iterators.

The given iterators, named left and right, must return objects each having a range attribute. Each iterator must return objects having disjoint ranges, i.e., no two objects from the same iterator may intersect. Each iterator must also return the objects sorted by min address. This iterator will then discover every case where an object from the left iterator overlaps an object from the right iterator, and return a pair for each such instance, in order of min address.

WARNING: To avoid heap pollution, this iterator re-uses the same Pair on each call to AbstractPeekableIterator.next(). If you need to save an overlapping pair, you must copy it.