Package ghidra.trace.util
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 iteratorR- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interfaceA means of obtaining the range attribute from each objectstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OverlappingObjectIterator.AddressRangeRangerstatic final OverlappingObjectIterator.CodeUnitRangerstatic final OverlappingObjectIterator.SnapRangeKeyRangerFields inherited from class generic.util.AbstractPeekableIterator
next, soughtNext -
Constructor Summary
ConstructorsConstructorDescriptionOverlappingObjectIterator(Iterator<? extends L> left, OverlappingObjectIterator.Ranger<? super L> leftRanger, Iterator<? extends R> right, OverlappingObjectIterator.Ranger<? super R> rightRanger) -
Method Summary
Modifier and TypeMethodDescriptionseekNext()Find the next element in this iterator, because the client called eitherAbstractPeekableIterator.nextorAbstractPeekableIterator.peek().Methods inherited from class generic.util.AbstractPeekableIterator
hasNext, next, peekMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Field Details
-
ADDRESS_RANGE
-
SNAP_RANGE_KEY
-
CODE_UNIT
-
-
Constructor Details
-
OverlappingObjectIterator
public OverlappingObjectIterator(Iterator<? extends L> left, OverlappingObjectIterator.Ranger<? super L> leftRanger, Iterator<? extends R> right, OverlappingObjectIterator.Ranger<? super R> rightRanger)
-
-
Method Details
-
seekNext
Description copied from class:AbstractPeekableIteratorFind the next element in this iterator, because the client called eitherAbstractPeekableIterator.nextorAbstractPeekableIterator.peek().- Specified by:
seekNextin classAbstractPeekableIterator<org.apache.commons.lang3.tuple.Pair<L,R>> - Returns:
- the next element
-