Class PropertyMapDB<T>
java.lang.Object
ghidra.program.database.DatabaseObject
ghidra.program.database.properties.PropertyMapDB<T>
- Type Parameters:
- T- property value type
- All Implemented Interfaces:
- PropertyMap<T>
- Direct Known Subclasses:
- IntPropertyMapDB,- LongPropertyMapDB,- ObjectPropertyMapDB,- StringPropertyMapDB,- UnsupportedMapDB,- VoidPropertyMapDB
Abstract class which defines a map containing properties over a set of addresses.
 The map is stored within a database table.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected AddressMapprotected ObjectCache<T> protected ChangeManagerprotected DBHandleprotected static final intprotected ErrorHandlerprotected Lockprotected Stringprotected static final String[]protected static final Field[]protected static final intprotected Tableprotected Schemaprotected static final String[]Fields inherited from class ghidra.program.database.DatabaseObjectkey
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcreateTable(Field valueField) Create the default propertyTable.voiddelete()Delete this property map and all underlying tables.getAddressKeyIterator(Address start, boolean before) Get an iterator over the long address keys which contain a property value.getAddressKeyIterator(Address start, Address end, boolean atStart) Get an iterator over the long address keys which contain a property value.getAddressKeyIterator(AddressSetView set, boolean atStart) Get an iterator over the long address keys which contain a property value.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.intgetSize()Get the number of properties in the map.protected StringGet the default property table name for this property map.static StringgetTableName(String propertyName) booleanhasProperty(Address addr) returns whether there is a property value at addr.booleanintersects(Address startAddr, Address endAddr) Given two addresses, indicate whether there is an address in that range (inclusive) having the property.booleanintersects(AddressSetView set) Indicate whether there is an address within the set which exists within this map.voidInvalidates the cache.voidMoves the properties defined in the range from the start address thru the end address to now be located beginning at the newStart address.protected booleanrefresh()Tells the object to refresh its state from the database.booleanRemove the property value at the given address.booleanremoveRange(Address startAddr, Address endAddr) Removes all property values within a given range.voidsetCacheSize(int size) Adjust the size of the underlying read cache.protected booleanThis method provides a cheap (lock free) way to test if an object is valid.Methods inherited from class ghidra.program.database.DatabaseObjectcheckDeleted, checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, refresh, setDeleted, setInvalidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.program.model.util.PropertyMapadd, get, getValueClass
- 
Field Details- 
SCHEMA_FIELD_NAMES
- 
NO_SCHEMA_FIELD_NAMES
- 
NO_SCHEMA_FIELDS
- 
PROPERTY_VALUE_COLprotected static final int PROPERTY_VALUE_COL- See Also:
 
- 
DEFAULT_CACHE_SIZEprotected static final int DEFAULT_CACHE_SIZE- See Also:
 
- 
dbHandle
- 
errHandler
- 
changeMgr
- 
schema
- 
propertyTable
- 
addrMap
- 
name
- 
cache
- 
lock
 
- 
- 
Method Details- 
getTableName
- 
validateDescription copied from class:DatabaseObjectThis method provides a cheap (lock free) way to test if an object is valid. If this object is invalid and not deleted, then the lock will be used to refresh as needed. A deleted object will not be refreshed.- Overrides:
- validatein class- DatabaseObject
- Parameters:
- lck- the lock that will be used if the object needs to be refreshed.
- Returns:
- true if object is valid or false if deleted
 
- 
getTableNameGet the default property table name for this property map.- Returns:
- default property map table name.
 
- 
createTableCreate the default propertyTable. This method may be called by add property methods if propertyTable is null.- Parameters:
- valueField- property value field type (null corresponds to void map table)
- Throws:
- IOException- if IO error occurs
 
- 
getNameDescription copied from interface:PropertyMapGet the name for this property map.- Specified by:
- getNamein interface- PropertyMap<T>
- Returns:
- map name
 
- 
setCacheSizepublic void setCacheSize(int size) Adjust the size of the underlying read cache.- Parameters:
- size- the size of the cache.
 
- 
deleteDelete this property map and all underlying tables. This method should be overidden if any table other than the default propertyTable is used.- Throws:
- IOException- if IO error occurs
 
- 
intersectsDescription copied from interface:PropertyMapGiven two addresses, indicate whether there is an address in that range (inclusive) having the property.- Specified by:
- intersectsin interface- PropertyMap<T>
- Parameters:
- startAddr- the start of the range.
- endAddr- the end of the range.
- Returns:
- boolean true if at least one address in the range has the property, false otherwise.
 
- 
intersectsDescription copied from interface:PropertyMapIndicate whether there is an address within the set which exists within this map.- Specified by:
- intersectsin interface- PropertyMap<T>
- Parameters:
- set- set of addresses
- Returns:
- boolean true if at least one address in the set has the property, false otherwise.
 
- 
removeRangeDescription copied from interface:PropertyMapRemoves all property values within a given range.- Specified by:
- removeRangein interface- PropertyMap<T>
- Parameters:
- startAddr- begin range
- endAddr- end range, inclusive
- Returns:
- true if any property value was removed; return false otherwise.
 
- 
removeDescription copied from interface:PropertyMapRemove the property value at the given address.- Specified by:
- removein interface- PropertyMap<T>
- Parameters:
- addr- the address where the property should be removed
- Returns:
- true if the property value was removed, false otherwise.
 
- 
hasPropertyDescription copied from interface:PropertyMapreturns whether there is a property value at addr.- Specified by:
- hasPropertyin interface- PropertyMap<T>
- Parameters:
- addr- the address in question
- Returns:
- true if map has value at specified address
 
- 
getNextPropertyAddressDescription copied from interface:PropertyMapGet the next address where the property value exists.- Specified by:
- getNextPropertyAddressin interface- PropertyMap<T>
- Parameters:
- addr- the address from which to begin the search (exclusive).
- Returns:
- property value location after specified addror null if none found
 
- 
getPreviousPropertyAddressDescription copied from interface:PropertyMapGet the previous Address where a property value exists.- Specified by:
- getPreviousPropertyAddressin interface- PropertyMap<T>
- Parameters:
- addr- the address from which to begin the search (exclusive).
- Returns:
- property value location after specified addror null if none found
 
- 
getFirstPropertyAddressDescription copied from interface:PropertyMapGet the first Address where a property value exists.- Specified by:
- getFirstPropertyAddressin interface- PropertyMap<T>
- Returns:
- first property value location or null if none found
 
- 
getLastPropertyAddressDescription copied from interface:PropertyMapGet the last Address where a property value exists.- Specified by:
- getLastPropertyAddressin interface- PropertyMap<T>
- Returns:
- last property value location or null if none found
 
- 
getSizepublic int getSize()Description copied from interface:PropertyMapGet the number of properties in the map.- Specified by:
- getSizein interface- PropertyMap<T>
- Returns:
- number of stored property values
 
- 
getAddressKeyIteratorpublic AddressKeyIterator getAddressKeyIterator(AddressSetView set, boolean atStart) throws IOException Get an iterator over the long address keys which contain a property value.- Parameters:
- set- addresses over which to iterate (null indicates all defined memory regions)
- atStart- true if the iterator should be positioned at the start of the range
- Returns:
- long address iterator.
- Throws:
- IOException- if IO error occurs
 
- 
getAddressKeyIteratorGet an iterator over the long address keys which contain a property value.- Parameters:
- start- iterator starting position
- before- true if the iterator should be positioned before the start address
- Returns:
- long address iterator.
- Throws:
- IOException- if IO error occurs
 
- 
getAddressKeyIteratorpublic AddressKeyIterator getAddressKeyIterator(Address start, Address end, boolean atStart) throws IOException Get an iterator over the long address keys which contain a property value.- Parameters:
- start- start of iterator address range
- end- end of iterator address range
- atStart- true if the iterator should be positioned at the start of the range
- Returns:
- long address iterator.
- Throws:
- IOException- if IO error occurs
 
- 
getPropertyIteratorDescription copied from interface:PropertyMapReturns an iterator over the indices having a property value.- Specified by:
- getPropertyIteratorin interface- PropertyMap<T>
- Parameters:
- start- minimum address
- end- maximum address
- Returns:
- forward property address iterator
 
- 
getPropertyIteratorDescription copied from interface:PropertyMapReturns an iterator over addresses that have a property value.- Specified by:
- getPropertyIteratorin interface- PropertyMap<T>
- Parameters:
- start- minimum address
- end- maximum address
- 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
 
- 
getPropertyIteratorDescription copied from interface:PropertyMapReturns an iterator over the addresses that a property value.- Specified by:
- getPropertyIteratorin interface- PropertyMap<T>
- Returns:
- forward property address iterator
 
- 
getPropertyIteratorDescription copied from interface:PropertyMapReturns an iterator over the addresses that have a property value and are in the given address set.- Specified by:
- getPropertyIteratorin interface- PropertyMap<T>
- Parameters:
- asv- the set of addresses to iterate over.
- Returns:
- forward property address iterator
 
- 
getPropertyIteratorDescription copied from interface:PropertyMapReturns an iterator over the addresses that have a property value and are in the given address set.- Specified by:
- getPropertyIteratorin interface- PropertyMap<T>
- 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
 
- 
getPropertyIteratorDescription copied from interface:PropertyMapReturns an iterator over the address having a property value.- Specified by:
- getPropertyIteratorin interface- PropertyMap<T>
- Parameters:
- start- the starting address
- 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
 
- 
invalidatepublic void invalidate()Invalidates the cache.
- 
refreshprotected boolean refresh()Description copied from class:DatabaseObjectTells the object to refresh its state from the database.- Specified by:
- refreshin class- DatabaseObject
- Returns:
- true if the object was able to refresh itself. Return false if the object was deleted. Objects that extend this class must implement a refresh method. If an object can never refresh itself, then it should always return false.
 
- 
moveRangeDescription copied from interface:PropertyMapMoves 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.- Specified by:
- moveRangein interface- PropertyMap<T>
- 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.
 
 
-