Package ghidra.app.plugin.assembler.sleigh.sem

# Class AbstractAssemblyResolution

java.lang.Object
ghidra.app.plugin.assembler.sleigh.sem.AbstractAssemblyResolution

All Implemented Interfaces:
  `AssemblyResolution`, `Comparable<AssemblyResolution>`

Direct Known Subclasses:
  `DefaultAssemblyResolvedBackfill`, `DefaultAssemblyResolvedError`, `DefaultAssemblyResolvedPatterns`

public abstract class AbstractAssemblyResolution extends Object implements AssemblyResolution
The (often intermediate) result of assembly

These may represent a successful construction (`AssemblyResolvedPatterns`, a future field (`AssemblyResolvedBackfill`), or an error (`AssemblyResolvedError`).

This class also provides the static factory methods for constructing any of its subclasses.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final List<AssemblyResolution>`
  `children`
  `protected final String`
  `description`
  `protected final AbstractAssemblyResolutionFactory<?,?>`
  `factory`
  `protected final AssemblyResolution`
  `right`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractAssemblyResolution(AbstractAssemblyResolutionFactory<?,?> factory, String description, List<? extends AssemblyResolution> children, AssemblyResolution right)`
  Construct a resolution

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected String`
  `childrenToString(String indent)`
  Get the child portion of `toString()`
  `void`
  `collectAllRight(Collection<AssemblyResolution> into)`
  `int`
  `compareTo(AssemblyResolution that)`
  `protected abstract int`
  `computeHash()`
  `protected List<AssemblyResolution>`
  `getAllRight()`
  `List<AssemblyResolution>`
  `getChildren()`
  `String`
  `getDescription()`
  `AssemblyResolution`
  `getRight()`
  `boolean`
  `hasChildren()`
  Check if this record has children
  `int`
  `hashCode()`
  `abstract AssemblyResolution`
  `shift(int amt)`
  Shift the resolution's instruction pattern to the right, if applicable
  `String`
  `toString()`
  `String`
  `toString(String indent)`
  Used only by parents: get a multi-line description of this record, indented
  `AssemblyResolution`
  `withoutRight()`
  Get this same resolution, but without any right siblings
  `abstract AssemblyResolution`
  `withRight(AssemblyResolution right)`
  Get this same resolution, but with the given right sibling

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

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

  ### Methods inherited from interface ghidra.app.plugin.assembler.sleigh.sem.AssemblyResolution

  `isBackfill, isError, lineToString, parent`

- ## Field Details

  - ### factory

    protected final AbstractAssemblyResolutionFactory<?,?> factory

  - ### description

    protected final String description

  - ### children

    protected final List<AssemblyResolution> children

  - ### right

    protected final AssemblyResolution right

- ## Constructor Details

  - ### AbstractAssemblyResolution

    protected AbstractAssemblyResolution(AbstractAssemblyResolutionFactory<?,?> factory, String description, List<? extends AssemblyResolution> children, AssemblyResolution right)
    Construct a resolution
    Parameters:
      `factory` - the factory
      `description` - a textual description used as part of `toString()`
      `children` - for record keeping, any children used in constructing this resolution
      `right` - the right sibling

- ## Method Details

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### computeHash

    protected abstract int computeHash()

  - ### getAllRight

    protected List<AssemblyResolution> getAllRight()

  - ### collectAllRight

    public void collectAllRight(Collection<AssemblyResolution> into)
    Specified by:
      `collectAllRight` in interface `AssemblyResolution`

  - ### childrenToString

    protected String childrenToString(String indent)
    Get the child portion of `toString()`

    If a subclass has another, possible additional, notion of children that it would like to include in `toString()`, it must override this method.

    Parameters:
      `indent` - the current indentation
    Returns:
      the indented description for each child on its own line
    See Also:
      - `hasChildren()`

  - ### toString

    public String toString(String indent)
    Description copied from interface: `AssemblyResolution`
    Used only by parents: get a multi-line description of this record, indented
    Specified by:
      `toString` in interface `AssemblyResolution`
    Parameters:
      `indent` - the current indentation
    Returns:
      the indented description

  - ### toString

    public String toString()
    Description copied from interface: `AssemblyResolution`

    Describe this record including indented children, grandchildren, etc., each on its own line.

    Specified by:
      `toString` in interface `AssemblyResolution`
    Overrides:
      `toString` in class `Object`

  - ### compareTo

    public int compareTo(AssemblyResolution that)
    Specified by:
      `compareTo` in interface `Comparable<AssemblyResolution>`

  - ### hasChildren

    public boolean hasChildren()
    Description copied from interface: `AssemblyResolution`
    Check if this record has children

    If a subclass has another, possibly additional, notion of children that it would like to include in `AssemblyResolution.toString()`, it must override this method to return true when such children are present.

    Specified by:
      `hasChildren` in interface `AssemblyResolution`
    Returns:
      true if this record has children

  - ### shift

    public abstract AssemblyResolution shift(int amt)
    Description copied from interface: `AssemblyResolution`
    Shift the resolution's instruction pattern to the right, if applicable

    This also shifts any backfill and forbidden pattern records.

    Specified by:
      `shift` in interface `AssemblyResolution`
    Parameters:
      `amt` - the number of bytes to shift.
    Returns:
      the result

  - ### withoutRight

    public AssemblyResolution withoutRight()
    Get this same resolution, but without any right siblings
    Returns:
      the resolution

  - ### withRight

    public abstract AssemblyResolution withRight(AssemblyResolution right)
    Get this same resolution, but with the given right sibling
    Parameters:
      `right` - the right sibling
    Returns:
      the resolution

  - ### getDescription

    public String getDescription()
    Specified by:
      `getDescription` in interface `AssemblyResolution`

  - ### getChildren

    public List<AssemblyResolution> getChildren()
    Specified by:
      `getChildren` in interface `AssemblyResolution`

  - ### getRight

    public AssemblyResolution getRight()
    Specified by:
      `getRight` in interface `AssemblyResolution`