Methods Summary |
---|
public com.android.dx.dex.code.PositionList$Entry | get(int n)Gets the element at the given index. It is an error to call
this with the index for an element which was never set; if you
do that, this will throw NullPointerException .
return (Entry) get0(n);
|
public static com.android.dx.dex.code.PositionList | make(DalvInsnList insns, int howMuch)Extracts and returns the source position information out of an
instruction list.
switch (howMuch) {
case NONE: {
return EMPTY;
}
case LINES:
case IMPORTANT: {
// Valid.
break;
}
default: {
throw new IllegalArgumentException("bogus howMuch");
}
}
SourcePosition noInfo = SourcePosition.NO_INFO;
SourcePosition cur = noInfo;
int sz = insns.size();
PositionList.Entry[] arr = new PositionList.Entry[sz];
boolean lastWasTarget = false;
int at = 0;
for (int i = 0; i < sz; i++) {
DalvInsn insn = insns.get(i);
if (insn instanceof CodeAddress) {
lastWasTarget = true;;
continue;
}
SourcePosition pos = insn.getPosition();
if (pos.equals(noInfo) || pos.sameLine(cur)) {
continue;
}
if ((howMuch == IMPORTANT) && !lastWasTarget) {
continue;
}
cur = pos;
arr[at] = new PositionList.Entry(insn.getAddress(), pos);
at++;
lastWasTarget = false;
}
PositionList result = new PositionList(at);
for (int i = 0; i < at; i++) {
result.set(i, arr[i]);
}
result.setImmutable();
return result;
|
public void | set(int n, com.android.dx.dex.code.PositionList$Entry entry)Sets the entry at the given index.
set0(n, entry);
|