Package ghidra.program.database.register

# Class InMemoryRangeMapAdapter

java.lang.Object
ghidra.program.database.register.InMemoryRangeMapAdapter

All Implemented Interfaces:
  `RangeMapAdapter`

public class InMemoryRangeMapAdapter extends Object implements RangeMapAdapter

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InMemoryRangeMapAdapter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkWritableState()`
  Verify that adapter is in a writable state (i.e., valid transaction has been started).
  `void`
  `clearAll()`
  Clears all values.
  `void`
  `clearRange(Address start, Address end)`
  Clears all associated values in the given range.
  `AddressRangeIterator`
  `getAddressRangeIterator()`
  Returns an `IndexRangeIterator` over all stored values.
  `AddressRangeIterator`
  `getAddressRangeIterator(Address start, Address end)`
  Returns an `IndexRangeIterator` over all stored values in the given range.
  `byte[]`
  `getValue(Address address)`
  Returns the byte array that has been associated with the given index.
  `AddressRange`
  `getValueRangeContaining(Address addr)`
  Returns the bounding address-range containing addr and the the same value throughout.
  `void`
  `invalidate()`
  Notification that something has changed that may affect internal caching
  `boolean`
  `isEmpty()`
  Returns true if this storage has no associated values for any address
  `void`
  `moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor)`
  Move all values within an address range to a new range.
  `void`
  `set(Address start, Address end, byte[] bytes)`
  Associates the given byte array with all indexes in the given range.
  `void`
  `setLanguage(LanguageTranslator translator, Register mapReg, TaskMonitor monitor)`
  Update table name and values to reflect new base register

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

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

- ## Constructor Details

  - ### InMemoryRangeMapAdapter

    public InMemoryRangeMapAdapter()

- ## Method Details

  - ### clearRange

    public void clearRange(Address start, Address end)
    Description copied from interface: `RangeMapAdapter`
    Clears all associated values in the given range.
    Specified by:
      `clearRange` in interface `RangeMapAdapter`
    Parameters:
      `start` - the first address in the range to clear.
      `end` - the end address in the range to clear.
    See Also:
      - `RangeMapAdapter.clearRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address)`

  - ### clearAll

    public void clearAll()
    Description copied from interface: `RangeMapAdapter`
    Clears all values.
    Specified by:
      `clearAll` in interface `RangeMapAdapter`
    See Also:
      - `RangeMapAdapter.clearAll()`

  - ### getValueRangeContaining

    public AddressRange getValueRangeContaining(Address addr)
    Description copied from interface: `RangeMapAdapter`
    Returns the bounding address-range containing addr and the the same value throughout. This range will be limited by any value change associated with the base register.
    Specified by:
      `getValueRangeContaining` in interface `RangeMapAdapter`
    Parameters:
      `addr` - the containing address
    Returns:
      single value address-range containing addr
    See Also:
      - `RangeMapAdapter.getValueRangeContaining(ghidra.program.model.address.Address)`

  - ### getAddressRangeIterator

    public AddressRangeIterator getAddressRangeIterator(Address start, Address end)
    Description copied from interface: `RangeMapAdapter`
    Returns an `IndexRangeIterator` over all stored values in the given range. If the given range intersects an actual stored range either at the beginning or end, the iterator will return those ranges truncated to fit within the given range.
    Specified by:
      `getAddressRangeIterator` in interface `RangeMapAdapter`
    Parameters:
      `start` - the first Address in the range.
      `end` - the last Address (inclusive) index in the range.
    Returns:
      an `IndexRangeIterator` over all stored values.
    See Also:
      - `RangeMapAdapter.getAddressRangeIterator(ghidra.program.model.address.Address, ghidra.program.model.address.Address)`

  - ### getAddressRangeIterator

    public AddressRangeIterator getAddressRangeIterator()
    Description copied from interface: `RangeMapAdapter`
    Returns an `IndexRangeIterator` over all stored values.
    Specified by:
      `getAddressRangeIterator` in interface `RangeMapAdapter`
    Returns:
      an `IndexRangeIterator` over all stored values.
    See Also:
      - `RangeMapAdapter.getAddressRangeIterator()`

  - ### getValue

    public byte[] getValue(Address address)
    Description copied from interface: `RangeMapAdapter`
    Returns the byte array that has been associated with the given index.
    Specified by:
      `getValue` in interface `RangeMapAdapter`
    Parameters:
      `address` - the address at which to retrieve a byte array.
    Returns:
      the byte array that has been associated with the given index or null if no such association exists.
    See Also:
      - `RangeMapAdapter.getValue(ghidra.program.model.address.Address)`

  - ### set

    public void set(Address start, Address end, byte[] bytes)
    Description copied from interface: `RangeMapAdapter`
    Associates the given byte array with all indexes in the given range. Any existing values will be over written.
    Specified by:
      `set` in interface `RangeMapAdapter`
    Parameters:
      `start` - the first address in the range.
      `end` - the last Address(inclusive) in the range.
      `bytes` - the bytes to associate with the range.
    See Also:
      - `RangeMapAdapter.set(ghidra.program.model.address.Address, ghidra.program.model.address.Address, byte[])`

  - ### moveAddressRange

    public void moveAddressRange(Address fromAddr, Address toAddr, long length, TaskMonitor monitor) throws CancelledException
    Description copied from interface: `RangeMapAdapter`
    Move all values within an address range to a new range.
    Specified by:
      `moveAddressRange` in interface `RangeMapAdapter`
    Parameters:
      `fromAddr` - the first address of the range to be moved.
      `toAddr` - the address where to the range is to be moved.
      `length` - the number of addresses to move.
      `monitor` - the task monitor.
    Throws:
      `CancelledException` - if the user canceled the operation via the task monitor.
    See Also:
      - `RangeMapAdapter.moveAddressRange(ghidra.program.model.address.Address, ghidra.program.model.address.Address, long, ghidra.util.task.TaskMonitor)`

  - ### isEmpty

    public boolean isEmpty()
    Description copied from interface: `RangeMapAdapter`
    Returns true if this storage has no associated values for any address
    Specified by:
      `isEmpty` in interface `RangeMapAdapter`
    Returns:
      true if this storage has no associated values for any address
    See Also:
      - `RangeMapAdapter.isEmpty()`

  - ### checkWritableState

    public void checkWritableState()
    Description copied from interface: `RangeMapAdapter`
    Verify that adapter is in a writable state (i.e., valid transaction has been started).
    Specified by:
      `checkWritableState` in interface `RangeMapAdapter`

  - ### setLanguage

    public void setLanguage(LanguageTranslator translator, Register mapReg, TaskMonitor monitor) throws CancelledException
    Description copied from interface: `RangeMapAdapter`
    Update table name and values to reflect new base register
    Specified by:
      `setLanguage` in interface `RangeMapAdapter`
    Throws:
      `CancelledException`
    See Also:
      - `RangeMapAdapter.setLanguage(ghidra.program.util.LanguageTranslator, ghidra.program.model.lang.Register, ghidra.util.task.TaskMonitor)`

  - ### invalidate

    public void invalidate()
    Description copied from interface: `RangeMapAdapter`
    Notification that something has changed that may affect internal caching
    Specified by:
      `invalidate` in interface `RangeMapAdapter`