Class BytesFieldLocation

  • All Implemented Interfaces:
    java.lang.Comparable<ProgramLocation>

    public class BytesFieldLocation
    extends CodeUnitLocation
    The BytesFieldLocation class provides specific information about the BYTES field within a program location.
    • Constructor Detail

      • BytesFieldLocation

        public BytesFieldLocation​(Program program,
                                  Address addr,
                                  Address byteAddress,
                                  int[] componentPath,
                                  int columnInByte)
        Create a new BytesFieldLocation which represents a specific byte address.
        Parameters:
        program - the program for this location.
        addr - the address of the code unit containing this location.
        byteAddress - the address of this location which can be the address of a specific byte within a code unit.
        componentPath - the data component path which is specified as an array of indexes where each index indicates the index into nested structures. For instructions or simple data, this should be null.
        columnInByte - the character position in the the bytes
      • BytesFieldLocation

        public BytesFieldLocation​(Program program,
                                  Address addr)
        Creates a new BytesFieldLocation for the given address. The address will be adjusted to the beginning of the code unit containing that address(if it exists). The original address can be retrieved using the "getByteAddress()" method.
        Parameters:
        program - the program that this location is related.
        addr - the address of the byte for this location.
      • BytesFieldLocation

        public BytesFieldLocation()
        Default constructor needed for restoring a byte field location from XML.
    • Method Detail

      • getByteIndex

        public int getByteIndex()
        Returns the index of byte that represents the current program location. Sources that do not get this specific should simply return 0.
      • getColumn

        public int getColumn()
        This is overridden here because previous versions used to store the byte index in the column field. So if anyone was incorrectly using getColumn() to get the byte index, then this override will allow that to keep working.
        Overrides:
        getColumn in class ProgramLocation
      • getColumnInByte

        public int getColumnInByte()
        Returns the character position within the byte specified by getByteIndex(). Normally, this is 1,2, or 3 corresponding to before the byte, between the nibbles of the byte or past the byte. Sometimes, extra delimiters may exist allowing the position to be greater than 3.
      • getAddressForByte

        public Address getAddressForByte()