Package ghidra.program.util

# Class SubDataFieldLocation

java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.CodeUnitLocation
ghidra.program.util.SubDataFieldLocation

All Implemented Interfaces:
  `Cloneable`, `Comparable<ProgramLocation>`

public class SubDataFieldLocation extends CodeUnitLocation
The `SubDataFieldLocation` class contains specific location information within the Sub-data field of a CodeUnitLocation object.

- ## Field Summary

  ### Fields inherited from class ghidra.program.util.ProgramLocation

  `addr, program, refAddr`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SubDataFieldLocation()`
  Should only be used by XML restoration.
  `SubDataFieldLocation(Program program, Address addr, GroupPath path, int[] componentPath, Address refAddr, String rep, int charOffset, String fieldName)`
  Construct a new SubDataFieldLocation object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `String`
  `getDataRepresentation()`
  Returns a string representation of the dataValue at this location.
  `String`
  `getFieldName()`
  Returns the name of the sub-data field.
  `int`
  `hashCode()`
  `void`
  `restoreState(Program p, SaveState obj)`
  Restore this program location using the given program and save state object.
  `void`
  `saveState(SaveState obj)`
  Save this program location to the given save state object.
  `String`
  `toString()`
  Returns a String representation of this location.

  ### Methods inherited from class ghidra.program.util.CodeUnitLocation

  `isValid`

  ### Methods inherited from class ghidra.program.util.ProgramLocation

  `clone, compareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy`

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

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SubDataFieldLocation

    public SubDataFieldLocation(Program program, Address addr, GroupPath path, int[] componentPath, Address refAddr, String rep, int charOffset, String fieldName)
    Construct a new SubDataFieldLocation object.
    Parameters:
      `program` - the program of the location
      `addr` - address of the location
      `path` - path associated with the address (an address could appear at more than one group path); may be null
      `componentPath` - array of indexes for each nested data component; the index is the data component's index within its parent; may be null
      `refAddr` - the "referred to" address if the location is over a reference; may be null
      `rep` - the String representation of the operand.
      `charOffset` - the character position within the operand string.
      `fieldName` - the name of the sub-data field

  - ### SubDataFieldLocation

    public SubDataFieldLocation()
    Should only be used by XML restoration.

- ## Method Details

  - ### getDataRepresentation

    public String getDataRepresentation()
    Returns a string representation of the dataValue at this location.

  - ### getFieldName

    public String getFieldName()
    Returns the name of the sub-data field.

  - ### toString

    public String toString()
    Returns a String representation of this location.
    Overrides:
      `toString` in class `ProgramLocation`

  - ### hashCode

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

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `ProgramLocation`

  - ### restoreState

    public void restoreState(Program p, SaveState obj)
    Description copied from class: `ProgramLocation`
    Restore this program location using the given program and save state object.
    Overrides:
      `restoreState` in class `ProgramLocation`
    Parameters:
      `p` - program to restore from
      `obj` - the save state to restore from

  - ### saveState

    public void saveState(SaveState obj)
    Description copied from class: `ProgramLocation`
    Save this program location to the given save state object.
    Overrides:
      `saveState` in class `ProgramLocation`
    Parameters:
      `obj` - the save state object for saving the location