Class SpatialMap.EmptySpatialMap<DS extends BoundedShape<?>,T,Q>
- All Implemented Interfaces:
SpatialMap<DS,T, Q>
- Enclosing interface:
SpatialMap<DS extends BoundedShape<?>,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 -
Method Summary
-
Constructor Details
-
EmptySpatialMap
public EmptySpatialMap()
-
-
Method Details
-
put
Description copied from interface:SpatialMapPut an entry into the mapNote 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> { @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, thenDBTreeDataRecord.setRecordValue(Object)andDBTreeDataRecord.getRecordValue()should be implemented as field accessors.- Specified by:
putin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q> - Parameters:
shape- the shape of the entryvalue- the value for the entry- Returns:
- the value as stored in the map
-
remove
Description copied from interface:SpatialMapRemove an entry from the mapRemoves 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:
removein interfaceSpatialMap<DS extends BoundedShape<?>,T, Q> - Parameters:
shape- the shape of the entry to removevalue- the value of the entry to remove- Returns:
- true if the map was modified
-
remove
Description copied from interface:SpatialMapRemove an entry from the mapThis 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:
removein interfaceSpatialMap<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:SpatialMapGet or compute the size of this mapNote 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:
sizein interfaceSpatialMap<DS extends BoundedShape<?>,T, Q> - Returns:
- the number of data entries in the map
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
entries
- Specified by:
entriesin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
orderedEntries
- Specified by:
orderedEntriesin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
keys
- Specified by:
keysin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
orderedKeys
- Specified by:
orderedKeysin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
values
- Specified by:
valuesin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
orderedValues
- Specified by:
orderedValuesin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
reduce
- Specified by:
reducein interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
firstEntry
- Specified by:
firstEntryin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
firstKey
- Specified by:
firstKeyin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
firstValue
- Specified by:
firstValuein interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-
clear
public void clear()- Specified by:
clearin interfaceSpatialMap<DS extends BoundedShape<?>,T, Q>
-