Package ghidra.trace.database.map

# Class AbstractDBTracePropertyMap.DBTracePropertyMapSpace

java.lang.Object
ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapSpace<T,DR>
ghidra.trace.database.map.AbstractDBTracePropertyMap.DBTracePropertyMapSpace

All Implemented Interfaces:
  `DBTraceSpaceBased`, `TraceAddressSnapRangePropertyMapOperations<T>`, `TraceAddressSnapRangePropertyMapSpace<T>`, `TracePropertyMapOperations<T>`, `TracePropertyMapSpace<T>`, `TraceSpaceMixin`, `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

Enclosing class:
  `AbstractDBTracePropertyMap<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>>`

public class AbstractDBTracePropertyMap.DBTracePropertyMapSpace extends DBTraceAddressSnapRangePropertyMapSpace<T,DR> implements TracePropertyMapSpace<T>

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface ghidra.util.database.spatial.SpatialMap

  `SpatialMap.EmptySpatialMap<DS extends BoundedShape<?>,T,Q>`

- ## Field Summary

  ### Fields inherited from class ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapSpace

  `fullSpace, lock, map, space, trace, tree`

  ### Fields inherited from interface ghidra.util.database.spatial.SpatialMap

  `EMPTY_MAP`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTracePropertyMapSpace(String tableName, DBTrace trace, DBCachedObjectStoreFactory storeFactory, ReadWriteLock lock, AddressSpace space, Class<DR> dataType, DBTraceAddressSnapRangePropertyMap.DBTraceAddressSnapRangePropertyMapDataFactory<T,DR> dataFactory)`

- ## 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
  `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
  `Trace`
  `getTrace()`
  Get the trace containing the object
  `Class<T>`
  `getValueClass()`
  Get the class for values of the map
  `protected void`
  `makeWay(DR data, Lifespan span)`
  `protected void`
  `makeWay(Map.Entry<TraceAddressSnapRange,T> entry, Lifespan span)`
  `T`
  `put(TraceAddressSnapRange shape, T value)`
  Put an entry into 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

  ### Methods inherited from class ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMapSpace

  `checkIntegrity, clear, deleteData, deleteValue, entries, firstEntry, firstKey, firstValue, getAddressSetView, getAddressSetView, getAddressSpace, getDataByKey, getUserIndex, invalidateCache, isEmpty, keys, orderedEntries, orderedKeys, orderedValues, reduce, remove, remove, size, values`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.trace.database.space.DBTraceSpaceBased

  `assertInSpace, assertInSpace, explainLanguages, isMySpace, toAddress, toOverlay`

  ### Methods inherited from interface ghidra.trace.model.map.TraceAddressSnapRangePropertyMapOperations

  `put, put, put, put`

  ### Methods inherited from interface ghidra.trace.model.property.TracePropertyMapOperations

  `getAddressSetView`

  ### Methods inherited from interface ghidra.trace.model.property.TracePropertyMapSpace

  `clear, getAddressSpace, getEntries, getEntries, set, set`

  ### Methods inherited from interface ghidra.trace.util.TraceSpaceMixin

  `getFrameLevel, getThread`

- ## Constructor Details

  - ### DBTracePropertyMapSpace

    public DBTracePropertyMapSpace(String tableName, DBTrace trace, DBCachedObjectStoreFactory storeFactory, ReadWriteLock lock, AddressSpace space, Class<DR> dataType, DBTraceAddressSnapRangePropertyMap.DBTraceAddressSnapRangePropertyMapDataFactory<T,DR> dataFactory) throws VersionException, IOException
    Throws:
      `VersionException`
      `IOException`

- ## Method Details

  - ### getTrace

    public Trace getTrace()
    Description copied from interface: `TraceSpaceMixin`
    Get the trace containing the object
    Specified by:
      `getTrace` in interface `TracePropertyMapSpace<T>`
    Specified by:
      `getTrace` in interface `TraceSpaceMixin`
    Overrides:
      `getTrace` in class `DBTraceAddressSnapRangePropertyMapSpace<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>>`
    Returns:
      the trace

  - ### getValueClass

    public Class<T> getValueClass()
    Description copied from interface: `TracePropertyMapOperations`
    Get the class for values of the map
    Specified by:
      `getValueClass` in interface `TracePropertyMapOperations<T>`
    Returns:
      the value class

  - ### makeWay

    protected void makeWay(Map.Entry<TraceAddressSnapRange,T> entry, Lifespan span)

  - ### makeWay

    protected void makeWay(DR data, Lifespan span)

  - ### set

    public void set(Lifespan lifespan, Address address, T value)
    Description copied from interface: `TracePropertyMapOperations`
    Set a value at the given address over the given lifespan
    Specified by:
      `set` in interface `TracePropertyMapOperations<T>`
    Parameters:
      `lifespan` - the lifespan
      `address` - the address
      `value` - the value
    See Also:
      - `TracePropertyMapOperations.set(Lifespan, AddressRange, Object)`

  - ### set

    public void set(Lifespan lifespan, AddressRange range, T value)
    Description copied from interface: `TracePropertyMapOperations`
    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.

    Specified by:
      `set` in interface `TracePropertyMapOperations<T>`
    Parameters:
      `lifespan` - the lifespan
      `range` - the address range
      `value` - the value

  - ### get

    public T get(long snap, Address address)
    Description copied from interface: `TracePropertyMapOperations`
    Get the value at the given address-snap pair
    Specified by:
      `get` in interface `TracePropertyMapOperations<T>`
    Parameters:
      `snap` - the snap
      `address` - the address
    Returns:
      the value

  - ### getEntry

    public Map.Entry<TraceAddressSnapRange,T> getEntry(long snap, Address address)
    Description copied from interface: `TracePropertyMapOperations`
    Get the entry at the given address-snap pair
    Specified by:
      `getEntry` in interface `TracePropertyMapOperations<T>`
    Parameters:
      `snap` - the snap
      `address` - the address
    Returns:
      the entry, which includes the ranges and the value

  - ### getEntries

    public Collection<Map.Entry<TraceAddressSnapRange,T>> getEntries(Lifespan lifespan, AddressRange range)
    Description copied from interface: `TracePropertyMapOperations`
    Get the entries intersecting the given bounds
    Specified by:
      `getEntries` in interface `TracePropertyMapOperations<T>`
    Parameters:
      `lifespan` - the range of snaps
      `range` - the range of addresses
    Returns:
      the entries

  - ### clear

    public boolean clear(Lifespan span, AddressRange range)
    Description copied from interface: `TracePropertyMapOperations`
    Remove or truncate entries so that the given box contains no entries

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

    Specified by:
      `clear` in interface `TracePropertyMapOperations<T>`
    Parameters:
      `span` - the range of snaps
      `range` - the address range
    Returns:
      true if any entry was affected

  - ### put

    public T put(TraceAddressSnapRange shape, T value)
    Description copied from interface: `SpatialMap`
    Put an entry into the map

    Note that the map may copy, and possibly modify, the given value. The value returned is the value actually stored by the map. This may be useful when the map's values are identical to its records. This allows the creation of a "blank" entry with a given shape. The entry is then populated by the user.

         class MyDBDataRecord extends DBTreeDataRecord<MyShape, MyNodeShape, MyDBDataRecord> {
         	&#64;Override
         	protected void setValue(MyDBDataRecord value) {
         		// Do nothing: value ought to be null. Map will create and return "blank" record
         	}

         	protected MyDBDataRecord getValue() {
         		return this; // The record is the value
         	}
         }

         MyDBDataRecord rec = map.put(MyShape.create(args), null);
         rec.setSomething(6);
         rec.setAnother("My user data");

    This practice is preferred when the values are not simple, and/or when the shape is a property of the value. In other cases, e.g., when the value is an enum or a `Color`, then `DBTreeDataRecord.setRecordValue(Object)` and `DBTreeDataRecord.getRecordValue()` should be implemented as field accessors.

    Specified by:
      `put` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`
    Overrides:
      `put` in class `DBTraceAddressSnapRangePropertyMapSpace<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>>`
    Parameters:
      `shape` - the shape of the entry
      `value` - the value for the entry
    Returns:
      the value as stored in the map