类 CodeLocation
- java.lang.Object
-
- proguard.analysis.datastructure.Location
-
- proguard.analysis.datastructure.CodeLocation
-
- 所有已实现的接口:
java.lang.Comparable<Location>
public class CodeLocation extends Location
Represents a unique location in the bytecode. It comprises theClazzandMemberwhere it is contained, the offset therein and the corresponding line number in the source file (Location.UNKNOWN_LINEif it is unknown). Consider the following pseudo-bytecode example which contains code location comments:public class Test { // class "Test", member "field", line 3, offset 0 public String field; public String toString() { // class "Test", member "toString", line 6, offset 0 aload_0 // class "Test", member "toString", line 6, offset 1 getfield #1 <Test.field : Ljava/lang/String;> // class "Test", member "toString", line 6, offset 4 areturn } }- Inside methods: Like each location, instructions inside methods have a line number.
But as there may be several expressions on the same line, to correctly identify each
instruction we also need their bytecode offset. E.g. the
getfieldinstruction insidetoString()has the offset 1. - Fields: In this case
Test#field. A field location has a line number (3 in this example) but no offset, as this concept is only applicable to methods.
-
-
构造器概要
构造器 构造器 说明 CodeLocation(Clazz clazz, Member member, int offset)Create a code location with an unknown (Location.UNKNOWN_LINE) line number.CodeLocation(Clazz clazz, Member member, int offset, int line)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intcompareTo(Location o)booleanequals(java.lang.Object o)java.lang.StringgetExternalClassName()java.lang.StringgetMemberName()java.lang.StringgetName()Returns the name of the location, e.g., the signature of a CodeLocation, or the filename of a FileLocationinthashCode()java.lang.StringtoString()
-
-
-
构造器详细资料
-
CodeLocation
public CodeLocation(Clazz clazz, Member member, int offset)
Create a code location with an unknown (Location.UNKNOWN_LINE) line number.
-
-
方法详细资料
-
getExternalClassName
public java.lang.String getExternalClassName()
-
getMemberName
public java.lang.String getMemberName()
-
getName
public java.lang.String getName()
从类复制的说明:LocationReturns the name of the location, e.g., the signature of a CodeLocation, or the filename of a FileLocation
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- 覆盖:
equals在类中java.lang.Object
-
hashCode
public int hashCode()
- 覆盖:
hashCode在类中java.lang.Object
-
compareTo
public int compareTo(Location o)
-
-