Package ghidra.program.util

# Class FieldNameFieldLocation

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

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

public class FieldNameFieldLocation extends CodeUnitLocation
The `FieldNameFieldLocation` class provides specific information about the Function Name field within a program location.

- ## Field Summary

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

  `addr, program, refAddr`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FieldNameFieldLocation()`
  Default constructor needed for restoring a field name location from XML
  `FieldNameFieldLocation(Program program, Address addr, int[] componentPath, String fieldName, int charOffset)`
  Construct a new FieldNameFieldLocation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `Data`
  `getDataComponent()`
  Get the data component representing the named field
  `String`
  `getFieldName()`
  Returns the field name of this location.
  `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()`

  ### 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

  - ### FieldNameFieldLocation

    public FieldNameFieldLocation(Program program, Address addr, int[] componentPath, String fieldName, int charOffset)
    Construct a new FieldNameFieldLocation.
    Parameters:
      `program` - the program of the location
      `addr` - the address of the code unit
      `componentPath` - if not null, it is the array of indexes that point to a specific data type inside of another data type
      `fieldName` - the field name
      `charOffset` - the character position within the field name for this location.

  - ### FieldNameFieldLocation

    public FieldNameFieldLocation()
    Default constructor needed for restoring a field name location from XML

- ## Method Details

  - ### getFieldName

    public String getFieldName()
    Returns the field name of this location.
    Returns:
      the name.

  - ### hashCode

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

  - ### equals

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

  - ### 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

  - ### 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

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `ProgramLocation`

  - ### getDataComponent

    public Data getDataComponent()
    Get the data component representing the named field
    Returns:
      the data unit