Package ghidra.trace.database.map

# Class DBTraceAddressSnapRangePropertyMap<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>>

java.lang.Object
ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager<DBTraceAddressSnapRangePropertyMapSpace<T,DR>>
ghidra.trace.database.map.DBTraceAddressSnapRangePropertyMap<T,DR>

All Implemented Interfaces:
  `ErrorHandler`, `DBTraceManager`, `DBTraceDelegatingManager<DBTraceAddressSnapRangePropertyMapSpace<T,DR>>`, `TraceAddressSnapRangePropertyMap<T>`, `TraceAddressSnapRangePropertyMapOperations<T>`, `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

Direct Known Subclasses:
  `AbstractDBTracePropertyMap`, `DBTraceCommentAdapter`, `DBTraceDataSettingsAdapter`

public class DBTraceAddressSnapRangePropertyMap<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>> extends AbstractDBTraceSpaceBasedManager<DBTraceAddressSnapRangePropertyMapSpace<T,DR>> implements TraceAddressSnapRangePropertyMap<T>, DBTraceDelegatingManager<DBTraceAddressSnapRangePropertyMapSpace<T,DR>>

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `DBTraceAddressSnapRangePropertyMap.DBTraceAddressSnapRangePropertyMapDataFactory<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>>`

  ## Nested classes/interfaces inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager

  `AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry`

  ## Nested classes/interfaces inherited from interface ghidra.trace.database.space.DBTraceDelegatingManager

  `DBTraceDelegatingManager.ExcConsumer<T,E extends Throwable>, DBTraceDelegatingManager.ExcFunction<T,R,E extends Throwable>, DBTraceDelegatingManager.ExcPredicate<T,E extends Throwable>, DBTraceDelegatingManager.ExcSupplier<T,E extends Throwable>`

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

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final DBTraceAddressSnapRangePropertyMap.DBTraceAddressSnapRangePropertyMapDataFactory<T,DR>`
  `dataFactory`
  `protected final Class<DR>`
  `dataType`

  ### Fields inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager

  `baseLanguage, dbh, lock, name, NO_ADDRESS_SPACE, regSpacesByContainer, spaces, spaceStore, spacesView, threadManager, trace`

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

  `EMPTY_MAP`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceAddressSnapRangePropertyMap(String name, DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager, Class<DR> dataType, DBTraceAddressSnapRangePropertyMap.DBTraceAddressSnapRangePropertyMapDataFactory<T,DR> dataFactory)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  `protected DBTraceAddressSnapRangePropertyMapSpace<T,DR>`
  `createSpace(AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent)`
  `void`
  `deleteData(DR data)`
  `void`
  `deleteValue(T value)`
  For maps where values are the entries, remove a value
  `Collection<Map.Entry<TraceAddressSnapRange,T>>`
  `entries()`
  `Map.Entry<TraceAddressSnapRange,T>`
  `firstEntry()`
  `TraceAddressSnapRange`
  `firstKey()`
  `T`
  `firstValue()`
  `AddressSetView`
  `getAddressSetView(Lifespan span)`
  `AddressSetView`
  `getAddressSetView(Lifespan span, Predicate<T> predicate)`
  `DBTraceAddressSnapRangePropertyMapSpace<T,DR>`
  `getForSpace(AddressSpace space, boolean createIfAbsent)`
  `String`
  `getName()`
  `DBTraceAddressSnapRangePropertyMapSpace<T,DR>`
  `getRegisterSpace(TraceStackFrame frame, boolean createIfAbsent)`
  `DBTraceAddressSnapRangePropertyMapSpace<T,DR>`
  `getRegisterSpace(TraceThread thread, boolean createIfAbsent)`
  `boolean`
  `isEmpty()`
  `Collection<TraceAddressSnapRange>`
  `keys()`
  `Collection<Map.Entry<TraceAddressSnapRange,T>>`
  `orderedEntries()`
  `Collection<TraceAddressSnapRange>`
  `orderedKeys()`
  `Collection<T>`
  `orderedValues()`
  `T`
  `put(TraceAddressSnapRange shape, T value)`
  Put an entry into the map
  `Lock`
  `readLock()`
  `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`
  `reduce(DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery query)`
  `boolean`
  `remove(TraceAddressSnapRange shape, T value)`
  Remove an entry from the map
  `boolean`
  `remove(Map.Entry<TraceAddressSnapRange,T> entry)`
  Remove an entry from the map
  `int`
  `size()`
  Get or compute the size of this map
  `Collection<T>`
  `values()`
  `Lock`
  `writeLock()`

  ### Methods inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager

  `dbError, get, getActiveSpaces, getBaseLanguage, getForRegisterSpace, getForRegisterSpace, getForRegisterSpace, getLock, getSpaceByName, getTabledSpaces, getTrace, invalidateCache, loadSpaces, tableName`

  ### 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.DBTraceDelegatingManager

  `checkIsInMemory, delegateAddressSet, delegateAny, delegateCollection, delegateDeleteB, delegateDeleteV, delegateFirst, delegateHashSet, delegateRead, delegateRead, delegateReadB, delegateReadI, delegateReadI, delegateReadOr, delegateWrite, delegateWriteAll, delegateWriteI, delegateWriteV`

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

  `put, put, put, put`

- ## Field Details

  - ### dataType

    protected final Class<DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>> dataType

  - ### dataFactory

    protected final DBTraceAddressSnapRangePropertyMap.DBTraceAddressSnapRangePropertyMapDataFactory<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>> dataFactory

- ## Constructor Details

  - ### DBTraceAddressSnapRangePropertyMap

    public DBTraceAddressSnapRangePropertyMap(String name, DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager, Class<DR> dataType, DBTraceAddressSnapRangePropertyMap.DBTraceAddressSnapRangePropertyMapDataFactory<T,DR> dataFactory) throws IOException, VersionException
    Throws:
      `IOException`
      `VersionException`

- ## Method Details

  - ### getName

    public String getName()
    Specified by:
      `getName` in interface `TraceAddressSnapRangePropertyMap<T>`

  - ### createSpace

    protected DBTraceAddressSnapRangePropertyMapSpace<T,DR> createSpace(AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent) throws VersionException, IOException
    Specified by:
      `createSpace` in class `AbstractDBTraceSpaceBasedManager<DBTraceAddressSnapRangePropertyMapSpace<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>>>`
    Throws:
      `VersionException`
      `IOException`

  - ### getRegisterSpace

    public DBTraceAddressSnapRangePropertyMapSpace<T,DR> getRegisterSpace(TraceThread thread, boolean createIfAbsent)
    Specified by:
      `getRegisterSpace` in interface `TraceAddressSnapRangePropertyMap<T>`

  - ### getRegisterSpace

    public DBTraceAddressSnapRangePropertyMapSpace<T,DR> getRegisterSpace(TraceStackFrame frame, boolean createIfAbsent)
    Specified by:
      `getRegisterSpace` in interface `TraceAddressSnapRangePropertyMap<T>`

  - ### getForSpace

    public DBTraceAddressSnapRangePropertyMapSpace<T,DR> getForSpace(AddressSpace space, boolean createIfAbsent)
    Specified by:
      `getForSpace` in interface `DBTraceDelegatingManager<T>`
    Overrides:
      `getForSpace` in class `AbstractDBTraceSpaceBasedManager<DBTraceAddressSnapRangePropertyMapSpace<T,DR extends DBTraceAddressSnapRangePropertyMapTree.AbstractDBTraceAddressSnapRangePropertyMapData<T>>>`

  - ### readLock

    public Lock readLock()
    Specified by:
      `readLock` in interface `DBTraceDelegatingManager<T>`

  - ### writeLock

    public Lock writeLock()
    Specified by:
      `writeLock` in interface `DBTraceDelegatingManager<T>`

  - ### deleteValue

    public void deleteValue(T value)
    Description copied from interface: `TraceAddressSnapRangePropertyMapOperations`
    For maps where values are the entries, remove a value
    Specified by:
      `deleteValue` in interface `TraceAddressSnapRangePropertyMapOperations<T>`
    Parameters:
      `value` - the entry to remove

  - ### deleteData

    public void deleteData(DR data)

  - ### 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>`
    Parameters:
      `shape` - the shape of the entry
      `value` - the value for the entry
    Returns:
      the value as stored in the map

  - ### remove

    public boolean remove(TraceAddressSnapRange shape, T value)
    Description copied from interface: `SpatialMap`
    Remove an entry from the map

    Removes a single matching entry, if found, from the map. If you have a reference to an entry obtained from this map, use `SpatialMap.remove(Entry)` instead. Otherwise, this is the preferred method.

    Specified by:
      `remove` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`
    Parameters:
      `shape` - the shape of the entry to remove
      `value` - the value of the entry to remove
    Returns:
      true if the map was modified

  - ### remove

    public boolean remove(Map.Entry<TraceAddressSnapRange,T> entry)
    Description copied from interface: `SpatialMap`
    Remove an entry from the map

    This method is preferred only when the given entry comes directly from this map. This spares the implementation from having to search for a matching entry. If the entry does not come from this map, it will behave like `SpatialMap.remove(BoundedShape, Object)`.

    Specified by:
      `remove` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`
    Parameters:
      `entry` - the entry to remove
    Returns:
      true if the map was modified

  - ### size

    public int size()
    Get or compute the size of this map

    Note that this may not necessarily be a quick operation, esp., if this map is the result of `SpatialMap.reduce(Object)`. In the worst case, all elements in the reduced map will be visited. Note this counts entries in memory spaces only. No register spaces are included.

    Specified by:
      `size` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`
    Returns:
      the number of data entries in the map

  - ### isEmpty

    public boolean isEmpty()
    Specified by:
      `isEmpty` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### entries

    public Collection<Map.Entry<TraceAddressSnapRange,T>> entries()
    Specified by:
      `entries` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### orderedEntries

    public Collection<Map.Entry<TraceAddressSnapRange,T>> orderedEntries()
    Specified by:
      `orderedEntries` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### keys

    public Collection<TraceAddressSnapRange> keys()
    Specified by:
      `keys` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### orderedKeys

    public Collection<TraceAddressSnapRange> orderedKeys()
    Specified by:
      `orderedKeys` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### values

    public Collection<T> values()
    Specified by:
      `values` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### orderedValues

    public Collection<T> orderedValues()
    Specified by:
      `orderedValues` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### reduce

    public SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery> reduce(DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery query)
    Specified by:
      `reduce` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### firstEntry

    public Map.Entry<TraceAddressSnapRange,T> firstEntry()
    Specified by:
      `firstEntry` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### firstKey

    public TraceAddressSnapRange firstKey()
    Specified by:
      `firstKey` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### firstValue

    public T firstValue()
    Specified by:
      `firstValue` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `SpatialMap<TraceAddressSnapRange,T,DBTraceAddressSnapRangePropertyMapTree.TraceAddressSnapRangeQuery>`

  - ### getAddressSetView

    public AddressSetView getAddressSetView(Lifespan span, Predicate<T> predicate)
    Specified by:
      `getAddressSetView` in interface `TraceAddressSnapRangePropertyMapOperations<T>`

  - ### getAddressSetView

    public AddressSetView getAddressSetView(Lifespan span)
    Specified by:
      `getAddressSetView` in interface `TraceAddressSnapRangePropertyMapOperations<T>`