Package ghidra.program.model.address
Class AddressRangeImpl
- java.lang.Object
- 
- ghidra.program.model.address.AddressRangeImpl
 
- 
- All Implemented Interfaces:
- AddressRange,- java.io.Serializable,- java.lang.Comparable<AddressRange>
 
 public class AddressRangeImpl extends java.lang.Object implements AddressRange, java.io.Serializable Implementation of an AddressRange. An AddressRange is a contiguous inclusive set of addresses from some minimum to a maximum address. Once created it is immutable.- Since:
- 2000-2-16
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description AddressRangeImpl(Address start, long length)Construct an AddressRange with the given start address and length.AddressRangeImpl(AddressRange range)Construct a new AddressRangeImpl from the given range.AddressRangeImpl(Address start, Address end)Construct an AddressRange with the given start and end address.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Address addr)Compares the given address to this address range.intcompareTo(AddressRange o)booleancontains(Address addr)Returns true if the given address is contained in the range.booleanequals(java.lang.Object obj)AddressSpacegetAddressSpace()java.math.BigIntegergetBigLength()Returns the number of addresses as a BigInteger.longgetLength()Returns the number of addresses in the range.AddressgetMaxAddress()AddressgetMinAddress()inthashCode()AddressRangeintersect(AddressRange range)Computes the intersection of this range with another.AddressRangeintersectRange(Address start, Address end)Computes the intersection of this range with another.booleanintersects(AddressRange range)Returns true if the given range intersects this range.booleanintersects(Address start, Address end)Returns true if the given range intersects this range.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
AddressRangeImplpublic AddressRangeImpl(AddressRange range) Construct a new AddressRangeImpl from the given range.- Parameters:
- range- the address range to copy.
 
 - 
AddressRangeImplpublic AddressRangeImpl(Address start, Address end) Construct an AddressRange with the given start and end address. If the start address is before the end address, they are swapped to be in order.- Parameters:
- start- start address in the range
- end- end address in the range
- Throws:
- java.lang.IllegalArgumentException- thrown if the minimum and maximum addresses are not comparable.
 
 - 
AddressRangeImplpublic AddressRangeImpl(Address start, long length) throws AddressOverflowException Construct an AddressRange with the given start address and length.- Parameters:
- start- start address in the range
- length- the length of the range.
- Throws:
- AddressOverflowException- if the length would wrap.
 
 
- 
 - 
Method Detail- 
containspublic boolean contains(Address addr) Description copied from interface:AddressRangeReturns true if the given address is contained in the range.- Specified by:
- containsin interface- AddressRange
- See Also:
- AddressRange.contains(ghidra.program.model.address.Address)
 
 - 
getAddressSpacepublic AddressSpace getAddressSpace() - Specified by:
- getAddressSpacein interface- AddressRange
- Returns:
- address space this range resides within
 
 - 
getMinAddresspublic Address getMinAddress() - Specified by:
- getMinAddressin interface- AddressRange
- Returns:
- the minimum address in the range.
- See Also:
- AddressRange.getMinAddress()
 
 - 
getMaxAddresspublic Address getMaxAddress() - Specified by:
- getMaxAddressin interface- AddressRange
- Returns:
- the maximum address in the range.
- See Also:
- AddressRange.getMaxAddress()
 
 - 
getLengthpublic long getLength() Description copied from interface:AddressRangeReturns the number of addresses in the range.- Specified by:
- getLengthin interface- AddressRange
- See Also:
- AddressRange.getLength()
 
 - 
getBigLengthpublic java.math.BigInteger getBigLength() Description copied from interface:AddressRangeReturns the number of addresses as a BigInteger.- Specified by:
- getBigLengthin interface- AddressRange
- Returns:
- the number of addresses as a BigInteger.
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
- See Also:
- Object.equals(java.lang.Object)
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
compareTopublic int compareTo(Address addr) Description copied from interface:AddressRangeCompares the given address to this address range.- Specified by:
- compareToin interface- AddressRange
- 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.
- See Also:
- AddressRange.compareTo(ghidra.program.model.address.Address)
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
- See Also:
- Object.toString()
 
 - 
intersectspublic boolean intersects(AddressRange range) Description copied from interface:AddressRangeReturns true if the given range intersects this range.- Specified by:
- intersectsin interface- AddressRange
- Parameters:
- range- the range to test for intersection with.
- See Also:
- AddressRange.intersects(ghidra.program.model.address.AddressRange)
 
 - 
intersectspublic boolean intersects(Address start, Address end) Description copied from interface:AddressRangeReturns true if the given range intersects this range.- Specified by:
- intersectsin interface- AddressRange
- Parameters:
- start- the first address in the range to test for intersection.
- end- the last address in the range to test for intersection.
- See Also:
- AddressRange.intersects(ghidra.program.model.address.Address, ghidra.program.model.address.Address)
 
 - 
intersectpublic AddressRange intersect(AddressRange range) Description copied from interface:AddressRangeComputes the intersection of this range with another.- Specified by:
- intersectin interface- AddressRange
- Parameters:
- range- the range to intersect this range with
- Returns:
- AddressRange the intersection or null if the ranges do not intersect.
- See Also:
- AddressRange.intersect(ghidra.program.model.address.AddressRange)
 
 - 
intersectRangepublic AddressRange intersectRange(Address start, Address end) Description copied from interface:AddressRangeComputes the intersection of this range with another.- Specified by:
- intersectRangein interface- AddressRange
- Parameters:
- start- of range
- end- end of range
- Returns:
- AddressRange the intersection or null if the ranges do not intersect.
- See Also:
- AddressRange.intersectRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address)
 
 - 
compareTopublic int compareTo(AddressRange o) - Specified by:
- compareToin interface- java.lang.Comparable<AddressRange>
 
 
- 
 
-