Methods Summary |
---|
public static com.android.dx.cf.code.LineNumberList | concat(com.android.dx.cf.code.LineNumberList list1, com.android.dx.cf.code.LineNumberList list2)Returns an instance which is the concatenation of the two given
instances.
if (list1 == EMPTY) {
// easy case
return list2;
}
int sz1 = list1.size();
int sz2 = list2.size();
LineNumberList result = new LineNumberList(sz1 + sz2);
for (int i = 0; i < sz1; i++) {
result.set(i, list1.get(i));
}
for (int i = 0; i < sz2; i++) {
result.set(sz1 + i, list2.get(i));
}
return result;
|
public com.android.dx.cf.code.LineNumberList$Item | get(int n)Gets the indicated item.
return (Item) get0(n);
|
public int | pcToLine(int pc)Gets the line number associated with the given address.
/*
* Line number entries don't have to appear in any particular
* order, so we have to do a linear search. TODO: If
* this turns out to be a bottleneck, consider sorting the
* list prior to use.
*/
int sz = size();
int bestPc = -1;
int bestLine = -1;
for (int i = 0; i < sz; i++) {
Item one = get(i);
int onePc = one.getStartPc();
if ((onePc <= pc) && (onePc > bestPc)) {
bestPc = onePc;
bestLine = one.getLineNumber();
if (bestPc == pc) {
// We can't do better than this
break;
}
}
}
return bestLine;
|
public void | set(int n, com.android.dx.cf.code.LineNumberList$Item item)Sets the item at the given index.
if (item == null) {
throw new NullPointerException("item == null");
}
set0(n, item);
|
public void | set(int n, int startPc, int lineNumber)Sets the item at the given index.
set0(n, new Item(startPc, lineNumber));
|