Package ghidra.program.model.symbol

# Interface OffsetReference

All Superinterfaces:
  `Comparable<Reference>`, `Reference`

public interface OffsetReference extends Reference
`OffsetReference` is a memory reference whose "to" address is computed from a base address plus an offset.

NOTE: References into the reserved EXTERNAL block must report `getToAddress()` the same as `getBaseAddress()` regardless of offset value due to symbol spacing limitations within the EXTERNAL block. See `MemoryBlock.EXTERNAL_BLOCK_NAME`.

- ## Field Summary

  ### Fields inherited from interface ghidra.program.model.symbol.Reference

  `MNEMONIC, OTHER`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Address`
  `getBaseAddress()`
  Returns the base address.
  `long`
  `getOffset()`
  Returns the offset.
  `Address`
  `getToAddress()`
  Return the base address plus the offset.

  ### Methods inherited from interface java.lang.Comparable

  `compareTo`

  ### Methods inherited from interface ghidra.program.model.symbol.Reference

  `getFromAddress, getOperandIndex, getReferenceType, getSource, getSymbolID, isEntryPointReference, isExternalReference, isMemoryReference, isMnemonicReference, isOffsetReference, isOperandReference, isPrimary, isRegisterReference, isShiftedReference, isStackReference`

- ## Method Details

  - ### getOffset

    long getOffset()
    Returns the offset.
    Returns:
      the offset

  - ### getBaseAddress

    Address getBaseAddress()
    Returns the base address.
    Returns:
      the address

  - ### getToAddress

    Address getToAddress()
    Return the base address plus the offset. The exception to this is the EXTERNAL block case where this method returns the base address regardless of the offset value.
    Specified by:
      `getToAddress` in interface `Reference`
    Returns:
      reference "to" address