com.android.dx.rop.code
Class SourcePosition

java.lang.Object
  extended by 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 Summary
static SourcePosition NO_INFO
          non-null; convenient "no information known" instance
 
Constructor Summary
SourcePosition(CstString sourceFile, int address, int line)
          Constructs an instance.
 
Method Summary
 boolean equals(Object other)
          
 int getAddress()
          Gets the original bytecode address.
 int getLine()
          Gets the original line number.
 CstString getSourceFile()
          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.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_INFO

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

Constructor Detail

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 Detail

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


Copyright © 2012. All Rights Reserved.