Methods Summary |
---|
public boolean | catchesAll()Returns whether or not this instance ends with a "catch-all"
handler.
int size = size();
if (size == 0) {
return false;
}
Entry last = get(size - 1);
return last.getExceptionType().equals(CstType.OBJECT);
|
public int | compareTo(com.android.dx.dex.code.CatchHandlerList other){@inheritDoc}
if (this == other) {
// Easy out.
return 0;
}
int thisSize = size();
int otherSize = other.size();
int checkSize = Math.min(thisSize, otherSize);
for (int i = 0; i < checkSize; i++) {
Entry thisEntry = get(i);
Entry otherEntry = other.get(i);
int compare = thisEntry.compareTo(otherEntry);
if (compare != 0) {
return compare;
}
}
if (thisSize < otherSize) {
return -1;
} else if (thisSize > otherSize) {
return 1;
}
return 0;
|
public com.android.dx.dex.code.CatchHandlerList$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 void | set(int n, com.android.dx.rop.cst.CstType exceptionType, int handler)Sets the entry at the given index.
set0(n, new Entry(exceptionType, handler));
|
public void | set(int n, com.android.dx.dex.code.CatchHandlerList$Entry entry)Sets the entry at the given index.
set0(n, entry);
|
public java.lang.String | toHuman(){@inheritDoc}
return toHuman("", "");
|
public java.lang.String | toHuman(java.lang.String prefix, java.lang.String header)Get the human form of this instance, prefixed on each line
with the string.
StringBuilder sb = new StringBuilder(100);
int size = size();
sb.append(prefix);
sb.append(header);
sb.append("catch ");
for (int i = 0; i < size; i++) {
Entry entry = get(i);
if (i != 0) {
sb.append(",\n");
sb.append(prefix);
sb.append(" ");
}
if ((i == (size - 1)) && catchesAll()) {
sb.append("<any>");
} else {
sb.append(entry.getExceptionType().toHuman());
}
sb.append(" -> ");
sb.append(Hex.u2or4(entry.getHandler()));
}
return sb.toString();
|