Package ghidra.trace.model.property

# Interface TracePropertyMapOperations<T>

Type Parameters:
  `T` - the type of values

All Known Subinterfaces:
  `TracePropertyMap<T>`, `TracePropertyMapSpace<T>`

All Known Implementing Classes:
  `AbstractDBTracePropertyMap`, `AbstractDBTracePropertyMap.DBTraceIntPropertyMap`, `AbstractDBTracePropertyMap.DBTraceLongPropertyMap`, `AbstractDBTracePropertyMap.DBTracePropertyMapSpace`, `AbstractDBTracePropertyMap.DBTraceSaveablePropertyMap`, `AbstractDBTracePropertyMap.DBTraceStringPropertyMap`, `AbstractDBTracePropertyMap.DBTraceVoidPropertyMap`

public interface TracePropertyMapOperations<T>
A map from address-snap pairs to user-defined values in a `Trace`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `clear(Lifespan span, AddressRange range)`
  Remove or truncate entries so that the given box contains no entries
  `T`
  `get(long snap, Address address)`
  Get the value at the given address-snap pair
  `AddressSetView`
  `getAddressSetView(Lifespan span)`
  Get the union of address ranges for entries which intersect the given span
  `Collection<Map.Entry<TraceAddressSnapRange,T>>`
  `getEntries(Lifespan lifespan, AddressRange range)`
  Get the entries intersecting the given bounds
  `Map.Entry<TraceAddressSnapRange,T>`
  `getEntry(long snap, Address address)`
  Get the entry at the given address-snap pair
  `Class<T>`
  `getValueClass()`
  Get the class for values of the map
  `void`
  `set(Lifespan lifespan, AddressRange range, T value)`
  Set a value over the given ranges
  `void`
  `set(Lifespan lifespan, Address address, T value)`
  Set a value at the given address over the given lifespan

- ## Method Details

  - ### getValueClass

    Class<T> getValueClass()
    Get the class for values of the map
    Returns:
      the value class

  - ### set

    void set(Lifespan lifespan, Address address, T value)
    Set a value at the given address over the given lifespan
    Parameters:
      `lifespan` - the lifespan
      `address` - the address
      `value` - the value
    See Also:
      - `set(Lifespan, AddressRange, Object)`

  - ### set

    void set(Lifespan lifespan, AddressRange range, T value)
    Set a value over the given ranges

    Setting a value of null still creates an entry, so that Void-typed maps function.

    When setting an overlapping value, existing entries are deleted or truncated to make space for the new entry. If an existing entry overlaps and its starting snap is contained in the new entry's span, the existing entry is deleted, regardless of whether or not its ending snap is also contained in the new entry's span. If the starting snap of the existing entry precedes the span of the new entry, the existing entry is truncated -- its ending snap is set to one less than the new entry's starting snap. Address ranges are never truncated.

    Parameters:
      `lifespan` - the lifespan
      `range` - the address range
      `value` - the value

  - ### get

    T get(long snap, Address address)
    Get the value at the given address-snap pair
    Parameters:
      `snap` - the snap
      `address` - the address
    Returns:
      the value

  - ### getEntry

    Map.Entry<TraceAddressSnapRange,T> getEntry(long snap, Address address)
    Get the entry at the given address-snap pair
    Parameters:
      `snap` - the snap
      `address` - the address
    Returns:
      the entry, which includes the ranges and the value

  - ### getEntries

    Collection<Map.Entry<TraceAddressSnapRange,T>> getEntries(Lifespan lifespan, AddressRange range)
    Get the entries intersecting the given bounds
    Parameters:
      `lifespan` - the range of snaps
      `range` - the range of addresses
    Returns:
      the entries

  - ### getAddressSetView

    AddressSetView getAddressSetView(Lifespan span)
    Get the union of address ranges for entries which intersect the given span
    Parameters:
      `span` - the range of snaps
    Returns:
      the address set

  - ### clear

    boolean clear(Lifespan span, AddressRange range)
    Remove or truncate entries so that the given box contains no entries

    This applies the same truncation rule as in `set(Lifespan, AddressRange, Object)`, except that no replacement entry is created.

    Parameters:
      `span` - the range of snaps
      `range` - the address range
    Returns:
      true if any entry was affected