Package ghidra.program.model.address
Interface AddressSetCollection
-
- All Known Implementing Classes:
SingleAddressSetCollection
,SynchronizedAddressSetCollection
public interface AddressSetCollection
This interface represents a collection of AddressSets (actually AddressSetViews). It defines a set of methods that can efficiently be performed on a collection of one or more AddressSets.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(Address address)
Test if the address is contained within any of the addressSets in this collection.Address
findFirstAddressInCommon(AddressSetView set)
Finds the first address in this collection that is also in the given addressSet.AddressSet
getCombinedAddressSet()
Returns a single AddressSet containing the union of all the addressSetViews in the collection.Address
getMaxAddress()
Returns the largest address in this collection or null if the collection is empty.Address
getMinAddress()
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.
-
-
-
Method Detail
-
intersects
boolean intersects(AddressSetView addrSet)
Determine if any AddressSet in this collection intersects with the specified address set.- Parameters:
addrSet
- address set to check intersection with.
-
intersects
boolean intersects(Address start, Address end)
Determine if range specified by start and end intersects with any of the AddressSets in this collection.- Parameters:
start
- start of rangeend
- end of range- Returns:
- true if the given range intersects this address set collection.
-
contains
boolean contains(Address address)
Test if the address is contained within any of the addressSets in this collection.- Parameters:
address
- address to test.- Returns:
- true if addr exists in the set, false otherwise.
-
hasFewerRangesThan
boolean hasFewerRangesThan(int rangeThreshold)
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.- Parameters:
rangeThreshold
- the number of ranges to test against.- Returns:
- true if the max possible ranges is less than the given threshold.
-
getCombinedAddressSet
AddressSet getCombinedAddressSet()
Returns a single AddressSet containing the union of all the addressSetViews in the collection.
-
findFirstAddressInCommon
Address findFirstAddressInCommon(AddressSetView set)
Finds the first address in this collection that is also in the given addressSet.- 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.
-
isEmpty
boolean isEmpty()
Returns true if all the AddressSets in this collection are empty.- Returns:
- true if all the AddressSets in this collection are empty.
-
getMinAddress
Address getMinAddress()
Returns the smallest 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.
-
getMaxAddress
Address getMaxAddress()
Returns the largest address in this collection or null if the collection is empty.- Returns:
- the largest address in this collection or null if the collection is empty.
-
-