Top Description Constructors Methods
org.droidparts.dexmaker.dx.rop.code

public final Class InsnList

extends FixedSizeList
Class Inheritance
Imports
org.droidparts.dexmaker.dx.util.FixedSizeList

List of Insn instances.

Constructor Summary

AccessConstructor and Description
public
InsnList(int
the size of the list
size
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true in the case described above.
contentEquals
(InsnList
to compare
b
)

Compares the contents of this InsnList with another.

public void
forEach(Insn.Visitor
non-null; visitor to use
visitor
)

Visits each instruction in the list, in order.

public Insn

Returns:

non-null; element at that index
get
(int
>= 0, < size(); which index
n
)

Gets the element at the given index.

public Insn

Returns:

non-null; the last instruction
getLast
()

Gets the last instruction.

public void
set(int
>= 0, < size(); which index
n
,
Insn
non-null; the instruction to set at n
insn
)

Sets the instruction at the given index.

public InsnList

Returns:

non-null; an appropriately-constructed instance
withRegisterOffset
(int
the amount to offset register numbers by
delta
)

Returns an instance that is identical to this one, except that the registers in each instruction are offset by the given amount.

Inherited from org.droidparts.dexmaker.dx.util.FixedSizeList:
equalsget0getOrNull0hashCodeset0shrinkToFitsizetoHumantoHumantoStringtoString

Constructor Detail

InsnListback to summary
public InsnList(int size)

Constructs an instance. All indices initially contain null.

Parameters
size:int

the size of the list

Method Detail

contentEqualsback to summary
public boolean contentEquals(InsnList b)

Compares the contents of this InsnList with another. The blocks must have the same number of insns, and each Insn must also return true to Insn.contentEquals().

Parameters
b:InsnList

to compare

Returns:boolean

true in the case described above.

forEachback to summary
public void forEach(Insn.Visitor visitor)

Visits each instruction in the list, in order.

Parameters
visitor:Insn.Visitor

non-null; visitor to use

getback to summary
public Insn 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.

Parameters
n:int

>= 0, < size(); which index

Returns:Insn

non-null; element at that index

getLastback to summary
public Insn getLast()

Gets the last instruction. This is just a convenient shorthand for get(size() - 1).

Returns:Insn

non-null; the last instruction

setback to summary
public void set(int n, Insn insn)

Sets the instruction at the given index.

Parameters
n:int

>= 0, < size(); which index

insn:Insn

non-null; the instruction to set at n

withRegisterOffsetback to summary
public InsnList 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. Mutability of the result is inherited from the original.

Parameters
delta:int

the amount to offset register numbers by

Returns:InsnList

non-null; an appropriately-constructed instance