Package ghidra.program.util

# Class VariableXRefFieldLocation

java.lang.Object
ghidra.program.util.ProgramLocation
ghidra.program.util.FunctionLocation
ghidra.program.util.VariableLocation
ghidra.program.util.VariableXRefFieldLocation

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

Direct Known Subclasses:
  `VariableXRefHeaderFieldLocation`

public class VariableXRefFieldLocation extends VariableLocation
The `VariableXRefFieldLocation` class provides specific information about the variable's cross reference field within a program location.

- ## Field Summary

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

  `functionAddr`

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

  `addr, program, refAddr`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VariableXRefFieldLocation()`
  Should only be used by XML restoration.
  `VariableXRefFieldLocation(Program program, Variable var, Address refAddr, int index, int charOffset)`
  Construct a new VariableXRefFieldLocation object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getIndex()`
  Returns the index of the XREF in the list.
  `Address`
  `getReferenceAddress()`
  Returns the reference address at this location.
  `String`
  `toString()`
  Returns a String representation of this location.

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

  `compareTo, equals, getVariable, isLocationFor, isParameter, isReturn, isValid, restoreState, saveState`

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

  `getFunctionAddress`

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

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

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

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

- ## Constructor Details

  - ### VariableXRefFieldLocation

    public VariableXRefFieldLocation(Program program, Variable var, Address refAddr, int index, int charOffset)
    Construct a new VariableXRefFieldLocation object.
    Parameters:
      `program` - the program of the location
      `var` - the variable
      `refAddr` - the reference address.
      `index` - the index of the XREF (tells which XREF).
      `charOffset` - the character position within the XREF.

  - ### VariableXRefFieldLocation

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

- ## Method Details

  - ### getIndex

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

  - ### getReferenceAddress

    public Address getReferenceAddress()
    Returns the reference address at this location.

  - ### toString

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