Package ghidra.program.model.address
Class SingleAddressSetCollection
java.lang.Object
ghidra.program.model.address.SingleAddressSetCollection
- All Implemented Interfaces:
AddressSetCollection
A simple implementation of AddressSetCollection that contains exactly one AddressSet.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Test if the address is contained within any of the addressSets in this collection.findFirstAddressInCommon
(AddressSetView otherSet) Finds the first address in this collection that is also in the given addressSet.Returns a single AddressSet containing the union of all the addressSetViews in the collection.Returns the largest address in this collection or null if the collection is empty.Returns the smallest address in this collection or null if the collection is empty.boolean
hasFewerRangesThan
(int rangeThreshold) Tests whether this collection of addressSets has approximately fewer ranges than the given threshold.boolean
intersects
(Address start, Address end) Determine if range specified by start and end intersects with any of the AddressSets in this collection.boolean
intersects
(AddressSetView addrSet) Determine if any AddressSet in this collection intersects with the specified address set.boolean
isEmpty()
Returns true if all the AddressSets in this collection are empty.
-
Constructor Details
-
SingleAddressSetCollection
-
-
Method Details
-
intersects
Description copied from interface:AddressSetCollection
Determine if any AddressSet in this collection intersects with the specified address set.- Specified by:
intersects
in interfaceAddressSetCollection
- Parameters:
addrSet
- address set to check intersection with.
-
intersects
Description copied from interface:AddressSetCollection
Determine if range specified by start and end intersects with any of the AddressSets in this collection.- Specified by:
intersects
in interfaceAddressSetCollection
- Parameters:
start
- start of rangeend
- end of range- Returns:
- true if the given range intersects this address set collection.
-
contains
Description copied from interface:AddressSetCollection
Test if the address is contained within any of the addressSets in this collection.- Specified by:
contains
in interfaceAddressSetCollection
- Parameters:
address
- address to test.- Returns:
- true if addr exists in the set, false otherwise.
-
hasFewerRangesThan
public boolean hasFewerRangesThan(int rangeThreshold) Description copied from interface:AddressSetCollection
Tests whether this collection of addressSets has approximately fewer ranges than the given threshold. This is probably estimated by adding up the number of ranges in each AddressSet in this collections. Returns true if the total is less than the given threshold.- Specified by:
hasFewerRangesThan
in interfaceAddressSetCollection
- Parameters:
rangeThreshold
- the number of ranges to test against.- Returns:
- true if the max possible ranges is less than the given threshold.
-
getCombinedAddressSet
Description copied from interface:AddressSetCollection
Returns a single AddressSet containing the union of all the addressSetViews in the collection.- Specified by:
getCombinedAddressSet
in interfaceAddressSetCollection
-
findFirstAddressInCommon
Description copied from interface:AddressSetCollection
Finds the first address in this collection that is also in the given addressSet.- Specified by:
findFirstAddressInCommon
in interfaceAddressSetCollection
- Parameters:
otherSet
- the addressSet to search for the first (lowest) common address.- Returns:
- the first address that is contained in this set and the given set.
-
isEmpty
public boolean isEmpty()Description copied from interface:AddressSetCollection
Returns true if all the AddressSets in this collection are empty.- Specified by:
isEmpty
in interfaceAddressSetCollection
- Returns:
- true if all the AddressSets in this collection are empty.
-
getMinAddress
Description copied from interface:AddressSetCollection
Returns the smallest address in this collection or null if the collection is empty.- Specified by:
getMinAddress
in interfaceAddressSetCollection
- Returns:
- the smallest address in this collection or null if the collection is empty.
-
getMaxAddress
Description copied from interface:AddressSetCollection
Returns the largest address in this collection or null if the collection is empty.- Specified by:
getMaxAddress
in interfaceAddressSetCollection
- Returns:
- the largest address in this collection or null if the collection is empty.
-