Package com.android.dx.rop.code
Class SourcePosition
java.lang.Object
com.android.dx.rop.code.SourcePosition
Information about a source position for code, which includes both a
line number and original bytecode address.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SourcePosition
non-null;
convenient "no information known" instance -
Constructor Summary
ConstructorDescriptionSourcePosition
(CstString sourceFile, int address, int line) Constructs an instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Gets the original bytecode address.int
getLine()
Gets the original line number.Gets the source file, if known.int
hashCode()
boolean
sameLine
(SourcePosition other) Returns whether the lines match between this instance and the one given.boolean
sameLineAndFile
(SourcePosition other) Returns whether the lines and files match between this instance and the one given.toString()
-
Field Details
-
NO_INFO
non-null;
convenient "no information known" instance
-
-
Constructor Details
-
SourcePosition
Constructs an instance.- Parameters:
sourceFile
-null-ok;
name of the file of origin ornull
if unknownaddress
->= -1;
original bytecode address or-1
if unknownline
->= -1;
original line number or-1
if unknown
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
sameLine
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
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
Gets the source file, if known.- Returns:
null-ok;
the source file ornull
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
-