Package ghidra.program.model.util
Interface PropertyMap<T>
- Type Parameters:
T
- property value type
- All Known Subinterfaces:
IntPropertyMap
,LongPropertyMap
,ObjectPropertyMap<T>
,SettingsPropertyMap
,StringPropertyMap
,VoidPropertyMap
- All Known Implementing Classes:
DefaultIntPropertyMap
,DefaultPropertyMap
,IntPropertyMapDB
,LongPropertyMapDB
,ObjectPropertyMapDB
,PropertyMapDB
,StringPropertyMapDB
,UnsupportedMapDB
,VoidPropertyMapDB
public interface PropertyMap<T>
Interface to define a map containing properties over a set of addresses.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a map-specific value type to the specified addressReturns the property value stored at the specified address or null if no property found.Get the first Address where a property value exists.Get the last Address where a property value exists.getName()
Get the name for this property map.Get the next address where the property value exists.Get the previous Address where a property value exists.Returns an iterator over the addresses that a property value.getPropertyIterator
(Address start, boolean forward) Returns an iterator over the address having a property value.getPropertyIterator
(Address start, Address end) Returns an iterator over the indices having a property value.getPropertyIterator
(Address start, Address end, boolean forward) Returns an iterator over addresses that have a property value.Returns an iterator over the addresses that have a property value and are in the given address set.getPropertyIterator
(AddressSetView asv, boolean forward) Returns an iterator over the addresses that have a property value and are in the given address set.int
getSize()
Get the number of properties in the map.Returns property value class.boolean
hasProperty
(Address addr) returns whether there is a property value at addr.boolean
intersects
(Address start, Address end) Given two addresses, indicate whether there is an address in that range (inclusive) having the property.boolean
intersects
(AddressSetView set) Indicate whether there is an address within the set which exists within this map.void
Moves the properties defined in the range from the start address thru the end address to now be located beginning at the newStart address.boolean
Remove the property value at the given address.boolean
removeRange
(Address start, Address end) Removes all property values within a given range.
-
Method Details
-
getName
String getName()Get the name for this property map.- Returns:
- map name
-
getValueClass
Returns property value class.- Returns:
- property value class or null for an unsupported map type
-
intersects
Given two addresses, indicate whether there is an address in that range (inclusive) having the property.- Parameters:
start
- the start of the range.end
- the end of the range.- Returns:
- boolean true if at least one address in the range has the property, false otherwise.
-
intersects
Indicate whether there is an address within the set which exists within this map.- Parameters:
set
- set of addresses- Returns:
- boolean true if at least one address in the set has the property, false otherwise.
-
removeRange
Removes all property values within a given range.- Parameters:
start
- begin rangeend
- end range, inclusive- Returns:
- true if any property value was removed; return false otherwise.
-
remove
Remove the property value at the given address.- Parameters:
addr
- the address where the property should be removed- Returns:
- true if the property value was removed, false otherwise.
-
hasProperty
returns whether there is a property value at addr.- Parameters:
addr
- the address in question- Returns:
- true if map has value at specified address
-
add
Add a map-specific value type to the specified address- Parameters:
addr
- property addressvalue
- property value or null (null remove value at address)- Throws:
IllegalArgumentException
- if property value type is inappropriate for this map
-
get
Returns the property value stored at the specified address or null if no property found.- Parameters:
addr
- property address- Returns:
- property value
-
getNextPropertyAddress
Get the next address where the property value exists.- Parameters:
addr
- the address from which to begin the search (exclusive).- Returns:
- property value location after specified
addr
or null if none found
-
getPreviousPropertyAddress
Get the previous Address where a property value exists.- Parameters:
addr
- the address from which to begin the search (exclusive).- Returns:
- property value location after specified
addr
or null if none found
-
getFirstPropertyAddress
Address getFirstPropertyAddress()Get the first Address where a property value exists.- Returns:
- first property value location or null if none found
-
getLastPropertyAddress
Address getLastPropertyAddress()Get the last Address where a property value exists.- Returns:
- last property value location or null if none found
-
getSize
int getSize()Get the number of properties in the map.- Returns:
- number of stored property values
-
getPropertyIterator
Returns an iterator over the indices having a property value.- Parameters:
start
- minimum addressend
- maximum address- Returns:
- forward property address iterator
-
getPropertyIterator
Returns an iterator over addresses that have a property value.- Parameters:
start
- minimum addressend
- maximum addressforward
- if true will iterate in increasing address order, otherwise it will start at the end and iterate in decreasing address order- Returns:
- property address iterator
-
getPropertyIterator
AddressIterator getPropertyIterator()Returns an iterator over the addresses that a property value.- Returns:
- forward property address iterator
-
getPropertyIterator
Returns an iterator over the addresses that have a property value and are in the given address set.- Parameters:
asv
- the set of addresses to iterate over.- Returns:
- forward property address iterator
-
getPropertyIterator
Returns an iterator over the addresses that have a property value and are in the given address set.- Parameters:
asv
- the set of addresses to iterate over.forward
- if true will iterate in increasing address order, otherwise it will start at the end and iterate in decreasing address order- Returns:
- property address iterator
-
getPropertyIterator
Returns an iterator over the address having a property value.- Parameters:
start
- the starting addressforward
- if true will iterate in increasing address order, otherwise it will start at the end and iterate in decreasing address order- Returns:
- property address iterator
-
moveRange
Moves the properties defined in the range from the start address thru the end address to now be located beginning at the newStart address. The moved properties will be located at the same relative location to the newStart address as they were previously to the start address.- Parameters:
start
- the start of the range to move.end
- the end of the range to move.newStart
- the new start location of the range of properties after the move.
-