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 Type
  Method
  Description
  `void`
  `add(Address addr, Object value)`
  Add a map-specific value type to the specified address
  `T`
  `get(Address addr)`
  Returns the property value stored at the specified address or null if no property found.
  `Address`
  `getFirstPropertyAddress()`
  Get the first Address where a property value exists.
  `Address`
  `getLastPropertyAddress()`
  Get the last Address where a property value exists.
  `String`
  `getName()`
  Get the name for this property map.
  `Address`
  `getNextPropertyAddress(Address addr)`
  Get the next address where the property value exists.
  `Address`
  `getPreviousPropertyAddress(Address addr)`
  Get the previous Address where a property value exists.
  `AddressIterator`
  `getPropertyIterator()`
  Returns an iterator over the addresses that a property value.
  `AddressIterator`
  `getPropertyIterator(Address start, boolean forward)`
  Returns an iterator over the address having a property value.
  `AddressIterator`
  `getPropertyIterator(Address start, Address end)`
  Returns an iterator over the indices having a property value.
  `AddressIterator`
  `getPropertyIterator(Address start, Address end, boolean forward)`
  Returns an iterator over addresses that have a property value.
  `AddressIterator`
  `getPropertyIterator(AddressSetView asv)`
  Returns an iterator over the addresses that have a property value and are in the given address set.
  `AddressIterator`
  `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.
  `Class<T>`
  `getValueClass()`
  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`
  `moveRange(Address start, Address end, Address newStart)`
  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(Address addr)`
  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

    Class<T> getValueClass()
    Returns property value class.
    Returns:
      property value class or null for an unsupported map type

  - ### intersects

    boolean intersects(Address start, Address end)
    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

    boolean intersects(AddressSetView set)
    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

    boolean removeRange(Address start, Address end)
    Removes all property values within a given range.
    Parameters:
      `start` - begin range
      `end` - end range, inclusive
    Returns:
      true if any property value was removed; return false otherwise.

  - ### remove

    boolean remove(Address addr)
    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

    boolean hasProperty(Address addr)
    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

    void add(Address addr, Object value)
    Add a map-specific value type to the specified address
    Parameters:
      `addr` - property address
      `value` - property value or null (null remove value at address)
    Throws:
      `IllegalArgumentException` - if property value type is inappropriate for this map

  - ### get

    T get(Address addr)
    Returns the property value stored at the specified address or null if no property found.
    Parameters:
      `addr` - property address
    Returns:
      property value

  - ### getNextPropertyAddress

    Address getNextPropertyAddress(Address addr)
    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

    Address getPreviousPropertyAddress(Address addr)
    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

    AddressIterator getPropertyIterator(Address start, Address end)
    Returns an iterator over the indices having a property value.
    Parameters:
      `start` - minimum address
      `end` - maximum address
    Returns:
      forward property address iterator

  - ### getPropertyIterator

    AddressIterator getPropertyIterator(Address start, Address end, boolean forward)
    Returns an iterator over addresses that have a property value.
    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

  - ### getPropertyIterator

    AddressIterator getPropertyIterator()
    Returns an iterator over the addresses that a property value.
    Returns:
      forward property address iterator

  - ### getPropertyIterator

    AddressIterator getPropertyIterator(AddressSetView asv)
    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

    AddressIterator getPropertyIterator(AddressSetView asv, boolean forward)
    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

    AddressIterator getPropertyIterator(Address start, boolean forward)
    Returns an iterator over the address having a property value.
    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

  - ### moveRange

    void moveRange(Address start, Address end, Address newStart)
    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.