Class LocalVariableList.Item
java.lang.Object
com.android.dx.cf.code.LocalVariableList.Item
- Enclosing class:
LocalVariableList
Item in a local variable table.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the variable's type descriptor.intgetIndex()Gets the variable's local index.intGets the length (in bytecodes) of this variable's scope.Gets the variable's LocalItem, a (name, signature) tupleintGets the start pc of this variable's scope.getType()Gets the variable's type descriptor.booleanGets whether this instance matches (describes) the given other instance exactly in all fields except type descriptor and type signature.booleanmatchesPcAndIndex(int pc, int index) Gets whether this instance matches (describes) the given address and index.withSignature(CstString newSignature) Constructs and returns an instance which is identical to this one, except that the signature is changed to the given value.
-
Constructor Details
-
Item
public Item(int startPc, int length, CstString name, CstString descriptor, CstString signature, int index) Constructs an instance.Note: At least one of
descriptororsignaturemust be passed as non-null.- Parameters:
startPc->= 0;the start pc of this variable's scopelength->= 0;the length (in bytecodes) of this variable's scopename-non-null;the variable's namedescriptor-null-ok;the variable's type descriptorsignature-null-ok;the variable's type signatureindex->= 0;the variable's local index
-
-
Method Details
-
getStartPc
public int getStartPc()Gets the start pc of this variable's scope.- Returns:
>= 0;the start pc of this variable's scope
-
getLength
public int getLength()Gets the length (in bytecodes) of this variable's scope.- Returns:
>= 0;the length (in bytecodes) of this variable's scope
-
getDescriptor
Gets the variable's type descriptor.- Returns:
null-ok;the variable's type descriptor
-
getLocalItem
Gets the variable's LocalItem, a (name, signature) tuple- Returns:
null-ok;the variable's type descriptor
-
getIndex
public int getIndex()Gets the variable's local index.- Returns:
>= 0;the variable's local index
-
getType
Gets the variable's type descriptor. This is a convenient shorthand forType.intern(getDescriptor().getString()).- Returns:
non-null;the variable's type
-
withSignature
Constructs and returns an instance which is identical to this one, except that the signature is changed to the given value.- Parameters:
newSignature-non-null;the new signature- Returns:
non-null;an appropriately-constructed instance
-
matchesPcAndIndex
public boolean matchesPcAndIndex(int pc, int index) Gets whether this instance matches (describes) the given address and index.- Parameters:
pc->= 0;the address in questionindex->= 0;the local variable index in question- Returns:
trueiff this instance matchespcandindex
-
matchesAllButType
Gets whether this instance matches (describes) the given other instance exactly in all fields except type descriptor and type signature.- Parameters:
other-non-null;the instance to compare to- Returns:
trueiff this instance matches
-