Package ghidra.program.util

# Class XRefFieldLocation

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

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

Direct Known Subclasses:
  `XRefHeaderFieldLocation`

public class XRefFieldLocation extends CodeUnitLocation
The `XRefFieldLocation` class contains specific location information within the XREF field of a CodeUnitLocation object.

- ## Field Summary

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

  `addr, program, refAddr`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XRefFieldLocation()`
  Creates a cross reference field location.
  `XRefFieldLocation(Program program, Address addr, int[] componentPath, Address refAddr, int index, int charOffset)`
  Construct a new XRefFieldLocation object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getIndex()`
  Returns the index of the XREF in the list.
  `String`
  `toString()`

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

  `isValid`

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

  `clone, compareAddr, compareTo, equals, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow, getTranslatedCopy, hashCode, restoreState, saveState`

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

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

- ## Constructor Details

  - ### XRefFieldLocation

    public XRefFieldLocation(Program program, Address addr, int[] componentPath, Address refAddr, int index, int charOffset)
    Construct a new XRefFieldLocation object.
    Parameters:
      `program` - the program of the location
      `addr` - address of the location 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 reference address at this location.
      `index` - the index of the XREF in the list of all XREFs at this address.
      `charOffset` - the character position within the XREF.

  - ### XRefFieldLocation

    public XRefFieldLocation()
    Creates a cross reference field location. Should only be used for XML restoring.

- ## Method Details

  - ### getIndex

    public int getIndex()
    Returns the index of the XREF in the list.

  - ### toString

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