Package ghidra.program.database.register
Class AddressRangeObjectMap<T>
java.lang.Object
ghidra.program.database.register.AddressRangeObjectMap<T>
Associates objects with address ranges.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearAll()
Clears all objects from mapvoid
void
clearRange
(Address start, Address end) Clears any object associations within the given range.boolean
Returns true if the associated address has an associated object even if the assocated object is null.Get the value or hole range containing the specified addressReturns anAddressRangeIterator
over all ranges that have associated objects.getAddressRangeIterator
(Address start, Address end) Returns anAddressRangeIterator
over all ranges that have associated objects within the given range.Returns the object associated with the given index or null if no object is associated with the given index.boolean
isEmpty()
void
moveAddressRange
(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) Move all values within an address range to a new range.void
Associates the given object with all indices in the given range.
-
Constructor Details
-
AddressRangeObjectMap
public AddressRangeObjectMap()Constructs a new ObjectRangeMap
-
-
Method Details
-
getAddressRangeIterator
Returns anAddressRangeIterator
over all ranges that have associated objects.- Returns:
- an
AddressRangeIterator
over all ranges that have associated objects.
-
getAddressRangeIterator
Returns anAddressRangeIterator
over all ranges that have associated objects within the given range. Object Ranges that overlap the beginning or end of the given range are included, but have thier start or end index adjusted to be in the given range.- Parameters:
start
- the first Address in the range to find all index ranges that have associated values.end
- the last Address(inclusive) in the range to find all index ranges that have associated values.- Returns:
- an
AddressRangeIterator
over all ranges that have associated objects within the given range.
-
moveAddressRange
public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws CancelledException Move all values within an address range to a new range.- Parameters:
fromAddr
- the first address of the range to be moved.toAddr
- the address where to the range is to be moved.length
- the number of addresses to move.monitor
- the task monitor.- Throws:
CancelledException
- if the user canceled the operation via the task monitor.
-
setObject
Associates the given object with all indices in the given range. The object may be null, but an association is still established. Use the clearRange() method to remove associations.- Parameters:
start
- the start of the range.end
- the end (inclusive) of the range.object
- the object to associate with the given range.
-
clearAll
public void clearAll()Clears all objects from map -
clearRange
Clears any object associations within the given range.- Parameters:
start
- the first index in the range to be cleared.end
- the last index in the range to be cleared.
-
contains
Returns true if the associated address has an associated object even if the assocated object is null.- Parameters:
address
- the index to check for an association.- Returns:
- true if the associated index has an associated object even if the assocated object is null.
-
getObject
Returns the object associated with the given index or null if no object is associated with the given index. Note that null is a valid association so a null result could be either no association or an actual association of the index to null. Use the contains() method first if the distinction is important. If the contains() method returns true, the result is cached so the next call to getObject() will be fast.- Parameters:
address
- the index at which to retrieve an assocated object.- Returns:
- the object (which can be null) associated with the given index or null if no such association exists.
-
isEmpty
public boolean isEmpty() -
getAddressRangeContaining
Get the value or hole range containing the specified address- Parameters:
addr
-
-
clearCache
public void clearCache()
-