Package ghidra.app.cmd.memory

# Class AbstractAddMemoryBlockCmd

java.lang.Object
ghidra.app.cmd.memory.AbstractAddMemoryBlockCmd

All Implemented Interfaces:
  `Command<Program>`

Direct Known Subclasses:
  `AddBitMappedMemoryBlockCmd`, `AddByteMappedMemoryBlockCmd`, `AddFileBytesMemoryBlockCmd`, `AddInitializedMemoryBlockCmd`, `AddUninitializedMemoryBlockCmd`

public abstract class AbstractAddMemoryBlockCmd extends Object implements Command<Program>
Base command class for adding memory blocks.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final String`
  `comment`
  `protected final boolean`
  `execute`
  `protected final boolean`
  `isOverlay`
  `protected final boolean`
  `isVolatile`
  `protected final long`
  `length`
  `protected String`
  `message`
  `protected final String`
  `name`
  `protected final boolean`
  `read`
  `protected final String`
  `source`
  `protected final Address`
  `start`
  `protected final boolean`
  `write`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `applyTo(Program program)`
  Applies the command to the given domain object.
  `protected abstract MemoryBlock`
  `createMemoryBlock(Memory memory)`
  `String`
  `getName()`
  Returns the name of this command.
  `String`
  `getStatusMsg()`
  Returns the status message indicating the status of the command.
  `void`
  `setArtificial(boolean a)`
  Prior to command execution the block's artificial attribute state may be specified and will be applied to the new memory block.

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

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

- ## Field Details

  - ### message

    protected String message

  - ### name

    protected final String name

  - ### comment

    protected final String comment

  - ### source

    protected final String source

  - ### start

    protected final Address start

  - ### length

    protected final long length

  - ### read

    protected final boolean read

  - ### write

    protected final boolean write

  - ### execute

    protected final boolean execute

  - ### isVolatile

    protected final boolean isVolatile

  - ### isOverlay

    protected final boolean isOverlay

- ## Method Details

  - ### setArtificial

    public void setArtificial(boolean a)
    Prior to command execution the block's artificial attribute state may be specified and will be applied to the new memory block.
    Parameters:
      `a` - block artificial attribute state

  - ### getStatusMsg

    public String getStatusMsg()
    Description copied from interface: `Command`
    Returns the status message indicating the status of the command.
    Specified by:
      `getStatusMsg` in interface `Command<Program>`
    Returns:
      reason for failure, or null if the status of the command was successful

  - ### getName

    public String getName()
    Description copied from interface: `Command`
    Returns the name of this command.
    Specified by:
      `getName` in interface `Command<Program>`
    Returns:
      the name of this command

  - ### createMemoryBlock

    protected abstract MemoryBlock createMemoryBlock(Memory memory) throws LockException, MemoryConflictException, AddressOverflowException, CancelledException
    Throws:
      `LockException`
      `MemoryConflictException`
      `AddressOverflowException`
      `CancelledException`

  - ### applyTo

    public boolean applyTo(Program program)
    Description copied from interface: `Command`
    Applies the command to the given domain object.
    Specified by:
      `applyTo` in interface `Command<Program>`
    Parameters:
      `program` - domain object that this command is to be applied.
    Returns:
      true if the command applied successfully