public final class ByteCatchList extends FixedSizeList
Code attribute.| Modifier and Type | Class and Description |
|---|---|
static class |
ByteCatchList.Item
Item in an exception handler list.
|
| Modifier and Type | Field and Description |
|---|---|
static ByteCatchList |
EMPTY
non-null; convenient zero-entry instance |
| Constructor and Description |
|---|
ByteCatchList(int count)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
byteLength()
Gets the total length of this structure in bytes, when included in
a
Code attribute. |
ByteCatchList.Item |
get(int n)
Gets the indicated item.
|
ByteCatchList |
listFor(int pc)
Gets the list of items active at the given address.
|
void |
set(int n,
ByteCatchList.Item item)
Sets the item at the given index.
|
void |
set(int n,
int startPc,
int endPc,
int handlerPc,
CstType exceptionClass)
Sets the item at the given index.
|
TypeList |
toRopCatchList()
Returns a rop-style catches list equivalent to this one.
|
IntList |
toTargetList(int noException)
Returns a target list corresponding to this instance.
|
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toHuman, toString, toStringisImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutablepublic static final ByteCatchList EMPTY
non-null; convenient zero-entry instancepublic ByteCatchList(int count)
count - the number of elements to be in the tablepublic int byteLength()
Code attribute. The returned value includes the
two bytes for exception_table_length.>= 2; the total length, in bytespublic ByteCatchList.Item get(int n)
n - >= 0; which itemnull-ok; the indicated itempublic void set(int n,
ByteCatchList.Item item)
n - >= 0, < size(); which entry to setitem - non-null; the itempublic void set(int n,
int startPc,
int endPc,
int handlerPc,
CstType exceptionClass)
n - >= 0, < size(); which entry to setstartPc - >= 0; the start pc (inclusive) of the handler's rangeendPc - >= startPc; the end pc (exclusive) of the
handler's rangehandlerPc - >= 0; the pc of the exception handlerexceptionClass - null-ok; the exception class or
null to catch all exceptions with this handlerpublic ByteCatchList listFor(int pc)
pc - which addressnon-null; list of exception handlers active at
pcpublic IntList toTargetList(int noException)
noException address appended if appropriate. The
result is automatically made immutable.noException - >= -1; the no-exception address to append, or
-1 not to append anythingnon-null; list of exception targets, with
noException appended if necessarypublic TypeList toRopCatchList()
non-null; the converted instanceCopyright © 2020. All Rights Reserved.