Class AbstractAssemblyResolution
- All Implemented Interfaces:
AssemblyResolution
,Comparable<AssemblyResolution>
- Direct Known Subclasses:
DefaultAssemblyResolvedBackfill
,DefaultAssemblyResolvedError
,DefaultAssemblyResolvedPatterns
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
Modifier and TypeFieldDescriptionprotected final List
<AssemblyResolution> protected final String
protected final AbstractAssemblyResolutionFactory
<?, ?> protected final AssemblyResolution
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractAssemblyResolution
(AbstractAssemblyResolutionFactory<?, ?> factory, String description, List<? extends AssemblyResolution> children, AssemblyResolution right) Construct a resolution -
Method Summary
Modifier and TypeMethodDescriptionprotected String
childrenToString
(String indent) Get the child portion oftoString()
void
int
compareTo
(AssemblyResolution that) protected abstract int
protected List
<AssemblyResolution> getRight()
boolean
Check if this record has childrenint
hashCode()
abstract AssemblyResolution
shift
(int amt) Shift the resolution's instruction pattern to the right, if applicabletoString()
Used only by parents: get a multi-line description of this record, indentedGet this same resolution, but without any right siblingsabstract AssemblyResolution
withRight
(AssemblyResolution right) Get this same resolution, but with the given right siblingMethods 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
-
description
-
children
-
right
-
-
Constructor Details
-
AbstractAssemblyResolution
protected AbstractAssemblyResolution(AbstractAssemblyResolutionFactory<?, ?> factory, String description, List<? extends AssemblyResolution> children, AssemblyResolution right) Construct a resolution- Parameters:
factory
- the factorydescription
- a textual description used as part oftoString()
children
- for record keeping, any children used in constructing this resolutionright
- the right sibling
-
-
Method Details
-
hashCode
public int hashCode() -
computeHash
protected abstract int computeHash() -
getAllRight
-
collectAllRight
- Specified by:
collectAllRight
in interfaceAssemblyResolution
-
childrenToString
Get the child portion oftoString()
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:
-
toString
Description copied from interface:AssemblyResolution
Used only by parents: get a multi-line description of this record, indented- Specified by:
toString
in interfaceAssemblyResolution
- Parameters:
indent
- the current indentation- Returns:
- the indented description
-
toString
Description copied from interface:AssemblyResolution
Describe this record including indented children, grandchildren, etc., each on its own line.
- Specified by:
toString
in interfaceAssemblyResolution
- Overrides:
toString
in classObject
-
compareTo
- Specified by:
compareTo
in interfaceComparable<AssemblyResolution>
-
hasChildren
public boolean hasChildren()Description copied from interface:AssemblyResolution
Check if this record has childrenIf 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 interfaceAssemblyResolution
- Returns:
- true if this record has children
-
shift
Description copied from interface:AssemblyResolution
Shift the resolution's instruction pattern to the right, if applicableThis also shifts any backfill and forbidden pattern records.
- Specified by:
shift
in interfaceAssemblyResolution
- Parameters:
amt
- the number of bytes to shift.- Returns:
- the result
-
withoutRight
Get this same resolution, but without any right siblings- Returns:
- the resolution
-
withRight
Get this same resolution, but with the given right sibling- Parameters:
right
- the right sibling- Returns:
- the resolution
-
getDescription
- Specified by:
getDescription
in interfaceAssemblyResolution
-
getChildren
- Specified by:
getChildren
in interfaceAssemblyResolution
-
getRight
- Specified by:
getRight
in interfaceAssemblyResolution
-