Package ghidra.program.model.address
Interface AddressRange
- All Superinterfaces:
Comparable<AddressRange>
,Iterable<Address>
- All Known Implementing Classes:
AddressRangeImpl
The AddressRange interface is used by any object
that represents a contiguous inclusive range of
addresses from a minimum address to a maximum
address. The entire range must fall within a
single address space.
- Since:
- 2000-02-16
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkValidRange
(Address start, Address end) Change the specified start and end addresses to see if they form a valid range within the sameAddressSpace
.int
Compares the given address to this address range.boolean
Returns true if the given address is contained in the range.Returns the number of addresses as a BigInteger.long
Returns the number of addresses in the range.intersect
(AddressRange range) Computes the intersection of this range with another.intersectRange
(Address start, Address end) Computes the intersection of this range with another.boolean
intersects
(AddressRange range) Returns true if the given range intersects this range.boolean
intersects
(Address start, Address end) Returns true if the given range intersects this range.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getLength
long getLength()Returns the number of addresses in the range. -
getBigLength
BigInteger getBigLength()Returns the number of addresses as a BigInteger.- Returns:
- the number of addresses as a BigInteger.
-
contains
Returns true if the given address is contained in the range. -
intersect
Computes the intersection of this range with another.- Parameters:
range
- the range to intersect this range with- Returns:
- AddressRange the intersection or null if the ranges do not intersect.
-
intersectRange
Computes the intersection of this range with another.- Parameters:
start
- of rangeend
- end of range- Returns:
- AddressRange the intersection or null if the ranges do not intersect.
-
intersects
Returns true if the given range intersects this range.- Parameters:
range
- the range to test for intersection with.
-
intersects
Returns true if the given range intersects this range.- Parameters:
start
- the first address in the range to test for intersection.end
- the last address in the range to test for intersection.
-
compareTo
Compares the given address to this address range.- Parameters:
addr
- the address to compare.- Returns:
- a negative integer if the address is greater than the maximum range address, zero if the address is in the range, and a positive integer if the address is less than minimum range address.
-
getMaxAddress
Address getMaxAddress()- Returns:
- the maximum address in the range.
-
getMinAddress
Address getMinAddress()- Returns:
- the minimum address in the range.
-
getAddressSpace
AddressSpace getAddressSpace()- Returns:
- address space this range resides within
-
checkValidRange
Change the specified start and end addresses to see if they form a valid range within the sameAddressSpace
.- Parameters:
start
- range start addressend
- range end address
-