Class UnionAddressSetView
- All Implemented Interfaces:
AddressSetView,Iterable<AddressRange>
AddressSetView defined as the union of many given
AddressSetViews.
This is equivalent to using AddressSetView.union(AddressSetView), but does not
materialize the difference. The choice of one over the other depends on the number of ranges in
the inputs and the frequency of use of the result. With few ranges, or in cases where you need to
access the entire result, anyway, just use the normal AddressRange. In cases with many,
many ranges and where only a small part of the result needs to be computed, use this view. It may
also be advantageous to use this if the inputs are themselves computed lazily.
This follows the conventions expected of an AddressSetView in that the returned ranges
are disjoint. Thus, it will combine intersecting and abutting ranges from among the inputs. For
example, the union of [[1,2]] and [[3,4]] is [[1,4]].
-
Constructor Summary
ConstructorsConstructorDescriptionUnionAddressSetView(AddressSetView... views) Construct the union of the given address set viewsConstruct the union of the given address set views -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if the address is contained within this set.getAddressRanges(boolean forward) Returns an iterator over the ranges in the specified ordergetAddressRanges(Address start, boolean forward) Returns an iterator of address ranges starting with the range that contains the given address.Get the maximum address for this address set.Get the minimum address for this address set.booleanisEmpty()Methods inherited from class ghidra.util.AbstractAddressSetView
contains, contains, findFirstAddressInCommon, fixStart, getAddresses, getAddresses, getFirstRange, getLastRange, getNumAddresses, getNumAddressRanges, getRangeContaining, hasSameAddresses, intersect, intersectRange, intersects, intersects, iterator, iterator, iterator, subtract, union, xorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.program.model.address.AddressSetView
getAddressCountBefore, spliterator, spliterator, spliterator, stream, stream, stream
-
Constructor Details
-
UnionAddressSetView
Construct the union of the given address set views- Parameters:
views- the input sets
-
UnionAddressSetView
Construct the union of the given address set views- Parameters:
views- the input sets
-
-
Method Details
-
contains
Description copied from interface:AddressSetViewTest if the address is contained within this set.- Parameters:
addr- address to test.- Returns:
- true if addr exists in the set, false otherwise.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceAddressSetView- Overrides:
isEmptyin classAbstractAddressSetView- Returns:
- true if this set is empty.
-
getMinAddress
Description copied from interface:AddressSetViewGet the minimum address for this address set.NOTE: An
AddressRangeshould generally not be formed using this address andAddressSetView.getMaxAddress()since it may span multipleAddressSpaces.- Specified by:
getMinAddressin interfaceAddressSetView- Overrides:
getMinAddressin classAbstractAddressSetView- Returns:
- the minimum address for this set. Returns null if the set is empty.
-
getMaxAddress
Description copied from interface:AddressSetViewGet the maximum address for this address set.NOTE: An
AddressRangeshould generally not be formed using this address andAddressSetView.getMaxAddress()since it may span multipleAddressSpaces.- Specified by:
getMaxAddressin interfaceAddressSetView- Overrides:
getMaxAddressin classAbstractAddressSetView- Returns:
- the maximum address for this set. Returns null if the set is empty.
-
getAddressRanges
- Returns:
- an iterator over the address ranges in this address set.
-
getAddressRanges
Description copied from interface:AddressSetViewReturns an iterator over the ranges in the specified order- Parameters:
forward- the ranges are returned from lowest to highest, otherwise from highest to lowest- Returns:
- an iterator over all the addresse ranges in the set.
-
getAddressRanges
Description copied from interface:AddressSetViewReturns an iterator of address ranges starting with the range that contains the given address.If there is no range containing the start address, then the first range will be the next range greater than the start address if going forward, otherwise the range less than the start address
- Parameters:
start- the address the first range should contain.forward- true iterators forward, false backwards- Returns:
- the AddressRange iterator
-