Class AddressSet
- All Implemented Interfaces:
- AddressSetView,- Iterable<AddressRange>
- Direct Known Subclasses:
- ExtCodeBlockImpl,- StubMemory
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new empty Address Set.AddressSet(Address addr) Create a new Address containing a single address.AddressSet(AddressRange range) Create a new Address Set from an address range.AddressSet(Address start, Address end) Creates a new Address set containing a single range The specified start and end addresses must form a valid range within a singleAddressSpace.AddressSet(AddressSetView set) Create a new Address Set from an existing Address Set.AddressSet(Program program, Address start, Address end) Creates a new Address set containing a single range.
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidAdds the given address to this set.final voidadd(AddressRange range) Add an address range to this set.voidAdds the range to this setfinal voidadd(AddressSetView addressSet) Add all addresses of the given AddressSet to this set.voidAdds the range to this setvoidAdds a range of addresses to this set.voidclear()Removes all addresses from the set.final booleanTest if the address is contained within this set.final booleanTest if the given address range is contained in this set.final booleancontains(AddressSetView addrSet) Test if the given address set is a subset of this set.final voiddelete(AddressRange range) Deletes an address range from this set.final voidDeletes a range of addresses from this setfinal voiddelete(AddressSetView addressSet) Delete all addresses in the given AddressSet from this set.voiddeleteFromMin(Address toAddr) Delete all addresses from the minimum address in the set up to and including toAddr.final voiddeleteRange(Address start, Address end) Deletes a range of addresses from this setvoiddeleteToMax(Address fromAddr) Delete all addresses starting at the fromAddr to the maximum address in the set.final booleanFinds the first address in this collection that is also in the given addressSet.getAddresses(boolean forward) Returns an iterator over all addresses in this set.getAddresses(Address start, boolean forward) Returns an iterator over the addresses in this address set starting at the start addressgetAddressRanges(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.Returns the first range in this set or null if the set is emptyReturns the last range in this set or null if the set is emptyGet the maximum address for this address set.Get the minimum address for this address set.longintgetRangeContaining(Address address) Returns the range that contains the given addressinthashCode()final booleanhasSameAddresses(AddressSetView addrSet) Returns true if the given address set contains the same set of addresses as this set.final AddressSetintersect(AddressSetView addrSet) Computes the intersection of this address set with the given address set.final AddressSetintersectRange(Address start, Address end) Computes the intersection of this address set with the given address range.booleanintersects(Address start, Address end) Determine if the start and end range intersects with the specified address set.booleanintersects(AddressSetView addrSet) Determine if this address set intersects with the specified address set.booleanisEmpty()iterator()Returns an iterator over the address ranges in this address set.iterator(boolean forward) Returns an iterator over the ranges in the specified orderReturns an iterator of address ranges starting with the range that contains the given address.Returns a string displaying the ranges in this set.final AddressSetsubtract(AddressSetView addrSet) Computes the difference of this address set with the given address set (this - set).toList()Returns a list of the AddressRanges in this set.final StringtoString()final AddressSetunion(AddressSetView addrSet) Computes the union of this address set with the given address set.xor(AddressSetView addrSet) Computes the exclusive-or of this address set with the given set.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.program.model.address.AddressSetViewgetAddressCountBefore, spliterator, spliterator, spliterator, stream, stream, stream
- 
Constructor Details- 
AddressSetpublic AddressSet()Create a new empty Address Set.
- 
AddressSetCreate a new Address Set from an address range.- Parameters:
- range- the range of addresses to include in this set.
 
- 
AddressSetCreates a new Address set containing a single range The specified start and end addresses must form a valid range within a singleAddressSpace.- Parameters:
- start- the start address of the range
- end- the end address of the range
- Throws:
- IllegalArgumentException- if the start and end addresses are in different spaces. To avoid this, use the constructor- AddressSet(Program, Address, Address)
 
- 
AddressSetCreates a new Address set containing a single range. Use of this method is generally discouraged since the set of addresses between a start and end address not contained within the sameAddressSpacemay be contain unexpected memory regions.- Parameters:
- program- the program whose AddressFactory is used to resolve address ranges where the start and end are in different address spaces. If you use the constructor with just the start and end address and the addresses are in different spaces, you would get an IllegalArgumentException.
- start- the start address of the range
- end- the end address of the range
 
- 
AddressSetCreate a new Address Set from an existing Address Set.- Parameters:
- set- Existing Address Set to clone.
 
- 
AddressSetCreate a new Address containing a single address.- Parameters:
- addr- the address to be included in this address set.
 
 
- 
- 
Method Details- 
addAdds the given address to this set.- Parameters:
- address- the address to add
 
- 
addAdd an address range to this set.- Parameters:
- range- the range to add.
 
- 
addAdds the range to this set- Parameters:
- start- the start address of the range to add
- end- the end address of the range to add
 
- 
addRangeAdds the range to this set- Parameters:
- start- the start address of the range to add
- end- the end address of the range to add
- Throws:
- IllegalArgumentException- if the start and end addresses are in different spaces. To avoid this, use the constructor- addRange(Program, Address, Address)
 
- 
addRangeAdds a range of addresses to this set.- Parameters:
- program- program whose AddressFactory is used to resolve address ranges that span multiple address spaces.
- start- the start address of the range to add
- end- the end address of the range to add
 
- 
addAdd all addresses of the given AddressSet to this set.- Parameters:
- addressSet- set of addresses to add.
 
- 
deleteDeletes an address range from this set.- Parameters:
- range- AddressRange to remove from this set
 
- 
deleteDeletes a range of addresses from this set- Parameters:
- start- the starting address of the range to be removed
- end- the ending address of the range to be removed (inclusive)
 
- 
deleteRangeDeletes a range of addresses from this set- Parameters:
- start- the starting address of the range to be removed
- end- the ending address of the range to be removed
 
- 
deleteDelete all addresses in the given AddressSet from this set.- Parameters:
- addressSet- set of addresses to remove from this set.
 
- 
clearpublic void clear()Removes all addresses from the set.
- 
printRangesReturns a string displaying the ranges in this set.- Returns:
- a string displaying the ranges in this set.
 
- 
toListReturns a list of the AddressRanges in this set.- Returns:
- a list of the AddressRanges in this set.
 
- 
containsDescription copied from interface:AddressSetViewTest if the address is contained within this set.- Specified by:
- containsin interface- AddressSetView
- Parameters:
- address- address to test.
- Returns:
- true if addr exists in the set, false otherwise.
 
- 
containsDescription copied from interface:AddressSetViewTest if the given address range is contained in this set.The specified start and end addresses must form a valid range within a single AddressSpace.- Specified by:
- containsin interface- AddressSetView
- Parameters:
- start- the first address in the range.
- end- the last address in the range.
- Returns:
- true if entire range is contained within the set, false otherwise.
 
- 
containsDescription copied from interface:AddressSetViewTest if the given address set is a subset of this set.- Specified by:
- containsin interface- AddressSetView
- Parameters:
- addrSet- the set to test.
- Returns:
- true if the entire set is contained within this set, false otherwise.
 
- 
hasSameAddressesDescription copied from interface:AddressSetViewReturns true if the given address set contains the same set of addresses as this set.- Specified by:
- hasSameAddressesin interface- AddressSetView
- Parameters:
- addrSet- the address set to compare.
- Returns:
- true if the given set contains the same addresses as this set.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
intersectsDescription copied from interface:AddressSetViewDetermine if this address set intersects with the specified address set.- Specified by:
- intersectsin interface- AddressSetView
- Parameters:
- addrSet- address set to check intersection with.
- Returns:
- true if this set intersects the specified addrSet else false
 
- 
intersectRangeDescription copied from interface:AddressSetViewComputes the intersection of this address set with the given address range.This method does not modify this address set. The specified start and end addresses must form a valid range within a single AddressSpace.- Specified by:
- intersectRangein interface- AddressSetView
- Parameters:
- start- start of range
- end- end of range
- Returns:
- AddressSet a new address set that contains all addresses that are contained in both this set and the given range.
 
- 
intersectDescription copied from interface:AddressSetViewComputes the intersection of this address set with the given address set.This method does not modify this address set. - Specified by:
- intersectin interface- AddressSetView
- Parameters:
- addrSet- the address set to intersect with.
- Returns:
- AddressSet a new address set that contains all addresses that are contained in both this set and the given set.
 
- 
unionDescription copied from interface:AddressSetViewComputes the union of this address set with the given address set.This method does not change this address set. - Specified by:
- unionin interface- AddressSetView
- Parameters:
- addrSet- The address set to be unioned with this address set.
- Returns:
- AddressSet A new address set which contains all the addresses from both this set and the given set.
 
- 
subtractDescription copied from interface:AddressSetViewComputes the difference of this address set with the given address set (this - set).Note that this is not the same as (set - this). This method does not change this address set. - Specified by:
- subtractin interface- AddressSetView
- Parameters:
- addrSet- the set to subtract from this set.
- Returns:
- AddressSet a new address set which contains all the addresses that are in this set, but not in the given set.
 
- 
isEmptypublic boolean isEmpty()- Specified by:
- isEmptyin interface- AddressSetView
- Returns:
- true if this set is empty.
 
- 
getMinAddressDescription 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 interface- AddressSetView
- Returns:
- the minimum address for this set. Returns null if the set is empty.
 
- 
getMaxAddressDescription 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 interface- AddressSetView
- Returns:
- the maximum address for this set. Returns null if the set is empty.
 
- 
getNumAddressRangespublic int getNumAddressRanges()- Specified by:
- getNumAddressRangesin interface- AddressSetView
- Returns:
- the number of address ranges in this set.
 
- 
iteratorDescription copied from interface:AddressSetViewReturns an iterator over the address ranges in this address set.- Specified by:
- iteratorin interface- AddressSetView
- Specified by:
- iteratorin interface- Iterable<AddressRange>
 
- 
iteratorDescription copied from interface:AddressSetViewReturns an iterator over the ranges in the specified order- Specified by:
- iteratorin interface- AddressSetView
- Parameters:
- forward- the ranges are returned from lowest to highest, otherwise from highest to lowest
- Returns:
- an iterator over all the address ranges in the set.
 
- 
iteratorDescription 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 - Specified by:
- iteratorin interface- AddressSetView
- Parameters:
- start- the address that the first range should contain.
- forward- true iterators forward, false backwards
- Returns:
- the AddressRange iterator
 
- 
getAddressRanges- Specified by:
- getAddressRangesin interface- AddressSetView
- Returns:
- an iterator over the address ranges in this address set.
 
- 
getAddressRangesDescription copied from interface:AddressSetViewReturns an iterator over the ranges in the specified order- Specified by:
- getAddressRangesin interface- AddressSetView
- 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.
 
- 
getAddressRangesDescription 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 - Specified by:
- getAddressRangesin interface- AddressSetView
- Parameters:
- start- the address the first range should contain.
- forward- true iterators forward, false backwards
- Returns:
- the AddressRange iterator
 
- 
getNumAddressespublic long getNumAddresses()- Specified by:
- getNumAddressesin interface- AddressSetView
- Returns:
- the number of addresses in this set.
 
- 
getAddressesDescription copied from interface:AddressSetViewReturns an iterator over all addresses in this set.- Specified by:
- getAddressesin interface- AddressSetView
- Parameters:
- forward- if true the address are return in increasing order, otherwise in decreasing order.
- Returns:
- an iterator over all addresses in this set.
 
- 
getAddressesDescription copied from interface:AddressSetViewReturns an iterator over the addresses in this address set starting at the start address- Specified by:
- getAddressesin interface- AddressSetView
- Parameters:
- start- address to start iterating at in the address set
- forward- if true address are return from lowest to highest, else from highest to lowest
- Returns:
- an iterator over the addresses in this address set starting at the start address
 
- 
intersectsDescription copied from interface:AddressSetViewDetermine if the start and end range intersects with the specified address set.The specified start and end addresses must form a valid range within a single AddressSpace.- Specified by:
- intersectsin interface- AddressSetView
- Parameters:
- start- start of range
- end- end of range
- Returns:
- true if the given range intersects this address set.
 
- 
xorDescription copied from interface:AddressSetViewComputes the exclusive-or of this address set with the given set.This method does not modify this address set. - Specified by:
- xorin interface- AddressSetView
- Parameters:
- addrSet- address set to exclusive-or with.
- Returns:
- AddressSet a new address set containing all addresses that are in either this set or the given set, but not in both sets
 
- 
toString
- 
getRangeContainingDescription copied from interface:AddressSetViewReturns the range that contains the given address- Specified by:
- getRangeContainingin interface- AddressSetView
- Parameters:
- address- the address for which to find a range.
- Returns:
- the range that contains the given address.
 
- 
getFirstRangeDescription copied from interface:AddressSetViewReturns the first range in this set or null if the set is empty- Specified by:
- getFirstRangein interface- AddressSetView
- Returns:
- the first range in this set or null if the set is empty
 
- 
getLastRangeDescription copied from interface:AddressSetViewReturns the last range in this set or null if the set is empty- Specified by:
- getLastRangein interface- AddressSetView
- Returns:
- the last range in this set or null if the set is empty
 
- 
findFirstAddressInCommonDescription copied from interface:AddressSetViewFinds the first address in this collection that is also in the given addressSet.- Specified by:
- findFirstAddressInCommonin interface- AddressSetView
- Parameters:
- set- the addressSet to search for the first (lowest) common address.
- Returns:
- the first address that is contained in this set and the given set.
 
- 
deleteFromMinDelete all addresses from the minimum address in the set up to and including toAddr. Addresses less-than-or-equal to specified address based uponAddresscomparison.- Parameters:
- toAddr- only addresses greater than toAddr will be left in the set.
 
- 
deleteToMaxDelete all addresses starting at the fromAddr to the maximum address in the set. Addresses greater-than-or-equal to specified address based uponAddresscomparison.- Parameters:
- fromAddr- only addresses less than fromAddr will be left in the set.
 
 
-