Package ghidra.util
Class UnionAddressRangeIterator
- All Implemented Interfaces:
PeekableIterator<AddressRange>,AddressRangeIterator,Iterable<AddressRange>,Iterator<AddressRange>
public class UnionAddressRangeIterator
extends AbstractPeekableIterator<AddressRange>
implements AddressRangeIterator
The iterator implementation backing several methods in
UnionAddressSetView-
Field Summary
Fields inherited from class generic.util.AbstractPeekableIterator
next, soughtNext -
Constructor Summary
ConstructorsConstructorDescriptionUnionAddressRangeIterator(Collection<Iterator<AddressRange>> iterators, boolean forward) Union into a single range iterator, several range iteratorsUnionAddressRangeIterator(Iterator<AddressRange> it, boolean forward) Coalesce (by union) ranges from a single iterator -
Method Summary
Modifier and TypeMethodDescriptioniterator()protected AddressRangeseekNext()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.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Constructor Details
-
UnionAddressRangeIterator
Coalesce (by union) ranges from a single iteratorThe ranges must be returned in order: in the forward direction, by increasing min address; in the reverse direction, by decreasing max address.
- Parameters:
it- the iteratorforward- true to coalesce in the forward direction, false for reverse
-
UnionAddressRangeIterator
Union into a single range iterator, several range iteratorsThe ranges will be coalesced so that each returned range is disconnected from any other. The ranges of each iterator must be returned in order by direction. While not recommended, the ranges of each iterator may overlap, so long as they are sorted as in
UnionAddressRangeIterator(Iterator, boolean)- Parameters:
iterators- the iterators to unionforward- true to union in the forward direction, false for reverse
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceAddressRangeIterator- Specified by:
iteratorin interfaceIterable<AddressRange>
-
seekNext
Description copied from class:AbstractPeekableIteratorFind the next element in this iterator, because the client called eitherAbstractPeekableIterator.nextorAbstractPeekableIterator.peek().- Specified by:
seekNextin classAbstractPeekableIterator<AddressRange>- Returns:
- the next element
-