Package ghidra.program.util
Class AddressFieldLocation
- java.lang.Object
-
- ghidra.program.util.ProgramLocation
-
- ghidra.program.util.CodeUnitLocation
-
- ghidra.program.util.AddressFieldLocation
-
- All Implemented Interfaces:
java.lang.Comparable<ProgramLocation>
public class AddressFieldLocation extends CodeUnitLocation
TheAddressFieldLocation
class provides specific information about a program location within the ADDRESS field.
-
-
Field Summary
-
Fields inherited from class ghidra.program.util.ProgramLocation
addr, program, refAddr
-
-
Constructor Summary
Constructors Constructor Description AddressFieldLocation()
Default constructor needed for restoring an address field location from XML.AddressFieldLocation(Program program, Address addr)
Construct a new default AddressFieldLocation for a given program address.AddressFieldLocation(Program program, Address addr, int[] componentPath, java.lang.String addrRepresentation, int charOffset)
Construct a new AddressFieldLocation object with the standard string representation and a position within that string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getAddressRepresentation()
Returns the standard string representation of the address in the address field.int
hashCode()
void
restoreState(Program restoreProgram, 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.java.lang.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
compareAddr, compareTo, getAddress, getByteAddress, getCharOffset, getColumn, getComponentPath, getLocation, getProgram, getRefAddress, getRow
-
-
-
-
Constructor Detail
-
AddressFieldLocation
public AddressFieldLocation(Program program, Address addr, int[] componentPath, java.lang.String addrRepresentation, int charOffset)
Construct a new AddressFieldLocation object with the standard string representation and a position within that string.- Parameters:
program
- the program of the locationaddr
- address of the locationcomponentPath
- if not null, it is the array of indexes that point to a specific data type inside of another data typeaddrRepresentation
- the string representation of the addresscharOffset
- the position into the string representation indicating the exact position within the Address Field.
-
AddressFieldLocation
public AddressFieldLocation(Program program, Address addr)
Construct a new default AddressFieldLocation for a given program address.- Parameters:
program
- the program of the locationaddr
- address of the location
-
AddressFieldLocation
public AddressFieldLocation()
Default constructor needed for restoring an address field location from XML.
-
-
Method Detail
-
getAddressRepresentation
public java.lang.String getAddressRepresentation()
Returns the standard string representation of the address in the address field. If there is no address, then null should be returned.
-
toString
public java.lang.String toString()
Returns a String representation of this location.- Overrides:
toString
in classProgramLocation
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classProgramLocation
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classProgramLocation
-
saveState
public void saveState(SaveState obj)
Description copied from class:ProgramLocation
Save this program location to the given save state object.- Overrides:
saveState
in classProgramLocation
- Parameters:
obj
- the save state object for saving the location
-
restoreState
public void restoreState(Program restoreProgram, SaveState obj)
Description copied from class:ProgramLocation
Restore this program location using the given program and save state object.- Overrides:
restoreState
in classProgramLocation
- Parameters:
restoreProgram
- program to restore fromobj
- the save state to restore from
-
-