Package com.android.dx.cf.code
Class ByteCatchList
java.lang.Object
com.android.dx.util.MutabilityControl
com.android.dx.util.FixedSizeList
com.android.dx.cf.code.ByteCatchList
- All Implemented Interfaces:
ToHuman
List of catch entries, that is, the elements of an "exception table,"
which is part of a standard
Code
attribute.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Item in an exception handler list. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ByteCatchList
non-null;
convenient zero-entry instance -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the total length of this structure in bytes, when included in aCode
attribute.get
(int n) Gets the indicated item.listFor
(int pc) Gets the list of items active at the given address.void
Sets the item at the given index.void
set
(int n, ByteCatchList.Item item) Sets the item at the given index.Returns a rop-style catches list equivalent to this one.toTargetList
(int noException) Returns a target list corresponding to this instance.Methods inherited from class com.android.dx.util.FixedSizeList
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toHuman, toString, toString
Methods inherited from class com.android.dx.util.MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable
-
Field Details
-
EMPTY
non-null;
convenient zero-entry instance
-
-
Constructor Details
-
ByteCatchList
public ByteCatchList(int count) Constructs an instance.- Parameters:
count
- the number of elements to be in the table
-
-
Method Details
-
byteLength
public int byteLength()Gets the total length of this structure in bytes, when included in aCode
attribute. The returned value includes the two bytes forexception_table_length
.- Returns:
>= 2;
the total length, in bytes
-
get
Gets the indicated item.- Parameters:
n
->= 0;
which item- Returns:
null-ok;
the indicated item
-
set
Sets the item at the given index.- Parameters:
n
->= 0, < size();
which entry to setitem
-non-null;
the item
-
set
Sets the item at the given index.- Parameters:
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 ornull
to catch all exceptions with this handler
-
listFor
Gets the list of items active at the given address. The result is automatically made immutable.- Parameters:
pc
- which address- Returns:
non-null;
list of exception handlers active atpc
-
toTargetList
Returns a target list corresponding to this instance. The result is a list of all the exception handler addresses, with the givennoException
address appended if appropriate. The result is automatically made immutable.- Parameters:
noException
->= -1;
the no-exception address to append, or-1
not to append anything- Returns:
non-null;
list of exception targets, withnoException
appended if necessary
-
toRopCatchList
Returns a rop-style catches list equivalent to this one.- Returns:
non-null;
the converted instance
-