Package ghidra.util.database.spatial

# Class AbstractConstraintsTreeSpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>,T,Q extends Query<DS,NS>>

java.lang.Object
ghidra.util.database.spatial.AbstractConstraintsTreeSpatialMap<DS,DR,NS,T,Q>

All Implemented Interfaces:
  `SpatialMap<DS,T,Q>`

Direct Known Subclasses:
  `Abstract2DRStarTree.AsSpatialMap`, `AbstractHyperRStarTree.AsSpatialMap`

public abstract class AbstractConstraintsTreeSpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>,T,Q extends Query<DS,NS>> extends Object implements SpatialMap<DS,T,Q>

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static class`
  `AbstractConstraintsTreeSpatialMap.ToArrayConsumer<A,T,U extends A>`
  `protected static class`
  `AbstractConstraintsTreeSpatialMap.ToListConsumer<A,T,U extends A>`

  ## 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 Q`
  `query`
  `protected final AbstractConstraintsTree<DS,DR,NS,?,T,Q>`
  `tree`

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

  `EMPTY_MAP`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractConstraintsTreeSpatialMap(AbstractConstraintsTree<DS,DR,NS,?,T,Q> tree, Q query)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected static int`
  `checkInt(long l)`
  `void`
  `clear()`
  `Collection<Map.Entry<DS,T>>`
  `entries()`
  `Map.Entry<DS,T>`
  `firstEntry()`
  `DS`
  `firstKey()`
  `T`
  `firstValue()`
  `boolean`
  `isEmpty()`
  `Collection<DS>`
  `keys()`
  `Collection<Map.Entry<DS,T>>`
  `orderedEntries()`
  `Collection<DS>`
  `orderedKeys()`
  `Collection<T>`
  `orderedValues()`
  `T`
  `put(DS shape, T value)`
  Put an entry into the map
  `boolean`
  `remove(DS shape, T value)`
  Remove an entry from the map
  `boolean`
  `remove(Map.Entry<DS,T> entry)`
  Remove an entry from the map
  `int`
  `size()`
  Get or compute the size of this map
  `Collection<T>`
  `values()`

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

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

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

  `reduce`

- ## Field Details

  - ### tree

    protected final AbstractConstraintsTree<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>,?,T,Q extends Query<DS,NS>> tree

  - ### query

    protected final Q extends Query<DS,NS> query

- ## Constructor Details

  - ### AbstractConstraintsTreeSpatialMap

    public AbstractConstraintsTreeSpatialMap(AbstractConstraintsTree<DS,DR,NS,?,T,Q> tree, Q query)

- ## Method Details

  - ### put

    public T put(DS 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<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`
    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(DS 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<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`
    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<DS,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<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`
    Parameters:
      `entry` - the entry to remove
    Returns:
      true if the map was modified

  - ### size

    public int size()
    Description copied from interface: `SpatialMap`
    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.

    Specified by:
      `size` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`
    Returns:
      the number of data entries in the map

  - ### isEmpty

    public boolean isEmpty()
    Specified by:
      `isEmpty` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### checkInt

    protected static int checkInt(long l)

  - ### entries

    public Collection<Map.Entry<DS,T>> entries()
    Specified by:
      `entries` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### orderedEntries

    public Collection<Map.Entry<DS,T>> orderedEntries()
    Specified by:
      `orderedEntries` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### keys

    public Collection<DS> keys()
    Specified by:
      `keys` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### orderedKeys

    public Collection<DS> orderedKeys()
    Specified by:
      `orderedKeys` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### values

    public Collection<T> values()
    Specified by:
      `values` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### orderedValues

    public Collection<T> orderedValues()
    Specified by:
      `orderedValues` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### firstEntry

    public Map.Entry<DS,T> firstEntry()
    Specified by:
      `firstEntry` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### firstKey

    public DS firstKey()
    Specified by:
      `firstKey` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### firstValue

    public T firstValue()
    Specified by:
      `firstValue` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `SpatialMap<DS extends BoundedShape<NS>,DR extends DBTreeDataRecord<DS,NS,T>,NS extends BoundingShape<NS>>`