Class SourcePosition

java.lang.Object
com.android.dx.rop.code.SourcePosition

public final class SourcePosition extends Object
Information about a source position for code, which includes both a line number and original bytecode address.
  • Field Details

    • NO_INFO

      public static final SourcePosition NO_INFO
      non-null; convenient "no information known" instance
  • Constructor Details

    • SourcePosition

      public SourcePosition(CstString sourceFile, int address, int line)
      Constructs an instance.
      Parameters:
      sourceFile - null-ok; name of the file of origin or null if unknown
      address - >= -1; original bytecode address or -1 if unknown
      line - >= -1; original line number or -1 if unknown
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • sameLine

      public boolean sameLine(SourcePosition other)
      Returns whether the lines match between this instance and the one given.
      Parameters:
      other - non-null; the instance to compare to
      Returns:
      true iff the lines match
    • sameLineAndFile

      public boolean sameLineAndFile(SourcePosition other)
      Returns whether the lines and files match between this instance and the one given.
      Parameters:
      other - non-null; the instance to compare to
      Returns:
      true iff the lines and files match
    • getSourceFile

      public CstString getSourceFile()
      Gets the source file, if known.
      Returns:
      null-ok; the source file or null if unknown
    • getAddress

      public int getAddress()
      Gets the original bytecode address.
      Returns:
      >= -1; the address or -1 if unknown
    • getLine

      public int getLine()
      Gets the original line number.
      Returns:
      >= -1; the original line number or -1 if unknown