Package com.android.dx.rop.code
Class InsnList
java.lang.Object
com.android.dx.util.MutabilityControl
com.android.dx.util.FixedSizeList
com.android.dx.rop.code.InsnList
- All Implemented Interfaces:
ToHuman
List of
Insn
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the contents of thisInsnList
with another.void
forEach
(Insn.Visitor visitor) Visits each instruction in the list, in order.get
(int n) Gets the element at the given index.getLast()
Gets the last instruction.void
Sets the instruction at the given index.withRegisterOffset
(int delta) Returns an instance that is identical to this one, except that the registers in each instruction are offset by the given amount.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
-
Constructor Details
-
InsnList
public InsnList(int size) Constructs an instance. All indices initially containnull
.- Parameters:
size
- the size of the list
-
-
Method Details
-
get
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 throwNullPointerException
.- Parameters:
n
->= 0, < size();
which index- Returns:
non-null;
element at that index
-
set
Sets the instruction at the given index.- Parameters:
n
->= 0, < size();
which indexinsn
-non-null;
the instruction to set atn
-
getLast
Gets the last instruction. This is just a convenient shorthand forget(size() - 1)
.- Returns:
non-null;
the last instruction
-
forEach
Visits each instruction in the list, in order.- Parameters:
visitor
-non-null;
visitor to use
-
contentEquals
Compares the contents of thisInsnList
with another. The blocks must have the same number of insns, and each Insn must also return true toInsn.contentEquals()
.- Parameters:
b
- to compare- Returns:
- true in the case described above.
-
withRegisterOffset
Returns an instance that is identical to this one, except that the registers in each instruction are offset by the given amount. Mutability of the result is inherited from the original.- Parameters:
delta
- the amount to offset register numbers by- Returns:
non-null;
an appropriately-constructed instance
-