Package ghidra.util.database.spatial

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

java.lang.Object
ghidra.util.database.spatial.SpatialMap.EmptySpatialMap<DS,T,Q>

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

Enclosing interface:
  `SpatialMap<DS extends BoundedShape<?>,T,Q>`

public static class SpatialMap.EmptySpatialMap<DS extends BoundedShape<?>,T,Q> extends Object implements SpatialMap<DS,T,Q>

- ## 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 interface ghidra.util.database.spatial.SpatialMap

  `EMPTY_MAP`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EmptySpatialMap()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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
  `SpatialMap<DS,T,Q>`
  `reduce(Q query)`
  `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`

- ## Constructor Details

  - ### EmptySpatialMap

    public EmptySpatialMap()

- ## 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<?>,T,Q>`
    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<?>,T,Q>`
    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<?>,T,Q>`
    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<?>,T,Q>`
    Returns:
      the number of data entries in the map

  - ### isEmpty

    public boolean isEmpty()
    Specified by:
      `isEmpty` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### entries

    public Collection<Map.Entry<DS,T>> entries()
    Specified by:
      `entries` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### orderedEntries

    public Collection<Map.Entry<DS,T>> orderedEntries()
    Specified by:
      `orderedEntries` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### keys

    public Collection<DS> keys()
    Specified by:
      `keys` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### orderedKeys

    public Collection<DS> orderedKeys()
    Specified by:
      `orderedKeys` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### values

    public Collection<T> values()
    Specified by:
      `values` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### orderedValues

    public Collection<T> orderedValues()
    Specified by:
      `orderedValues` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### reduce

    public SpatialMap<DS,T,Q> reduce(Q query)
    Specified by:
      `reduce` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### firstEntry

    public Map.Entry<DS,T> firstEntry()
    Specified by:
      `firstEntry` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### firstKey

    public DS firstKey()
    Specified by:
      `firstKey` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### firstValue

    public T firstValue()
    Specified by:
      `firstValue` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`

  - ### clear

    public void clear()
    Specified by:
      `clear` in interface `SpatialMap<DS extends BoundedShape<?>,T,Q>`