| java.lang.Object org.objectweb.asm.tree.InsnList
InsnList | public class InsnList (Code) | | A doubly linked list of
AbstractInsnNode objects. This
implementation is not thread safe.
|
Field Summary | |
public static boolean | check Indicates if preconditions of methods of this class must be checked. |
accept | public void accept(MethodVisitor mv)(Code) | | Makes the given visitor visit all of the instructions in this list.
Parameters: mv - the method visitor that must visit the instructions. |
clear | public void clear()(Code) | | Removes all of the instructions of this list.
|
contains | public boolean contains(AbstractInsnNode insn)(Code) | | Returns true if the given instruction belongs to this list.
This method always scans the instructions of this list until it finds the
given instruction or reaches the end of the list.
Parameters: insn - an instruction. true if the given instruction belongs to this list. |
get | public AbstractInsnNode get(int index)(Code) | | Returns the instruction whose index is given. This method builds a cache
of the instructions in this list to avoid scanning the whole list each
time it is called. Once the cache is built, this method run in constant
time. This cache is invalidated by all the methods that modify the list.
Parameters: index - the index of the instruction that must be returned. the instruction whose index is given. throws: IndexOutOfBoundsException - if (index < 0 || index >= size()). |
getFirst | public AbstractInsnNode getFirst()(Code) | | Returns the first instruction in this list.
the first instruction in this list, or null if thelist is empty. |
getLast | public AbstractInsnNode getLast()(Code) | | Returns the last instruction in this list.
the last instruction in this list, or null if the listis empty. |
indexOf | public int indexOf(AbstractInsnNode insn)(Code) | | Returns the index of the given instruction in this list. This method
builds a cache of the instruction indexes to avoid scanning the whole
list each time it is called. Once the cache is built, this method run in
constant time. The cache is invalidated by all the methods that modify
the list.
Parameters: insn - an instruction of this list. the index of the given instruction in this list. The result ofthis method is undefined if the given instruction does not belongto this list. Use InsnList.contains contains to test if aninstruction belongs to an instruction list or not. throws: IllegalArgumentException - if InsnList.check is true andif insn does not belong to this list. |
insert | public void insert(InsnList insns)(Code) | | Inserts the given instructions at the begining of this list.
Parameters: insns - an instruction list, which is cleared during the process. throws: IllegalArgumentException - if InsnList.check is true,and if insn == this. |
insert | public void insert(AbstractInsnNode i, AbstractInsnNode insn)(Code) | | Inserts the given instruction after the specified instruction.
Parameters: i - an instruction of this list after which insn must beinserted. Parameters: insn - the instruction to be inserted, which must not belong toany InsnList. throws: IllegalArgumentException - if InsnList.check is true,and if i does not belong to this list or if insn belongs to aninstruction list. |
insert | public void insert(AbstractInsnNode i, InsnList insns)(Code) | | Inserts the given instructions after the specified instruction.
Parameters: i - an instruction of this list after which the instructionsmust be inserted. Parameters: insns - the instruction list to be inserted, which is cleared duringthe process. throws: IllegalArgumentException - if InsnList.check is true,and if i does not belong to this list or if insns == this. |
iterator | public Iterator iterator()(Code) | | Returns an iterator over the instructions in this list.
an iterator over the instructions in this list. |
size | public int size()(Code) | | Returns the number of instructions in this list.
the number of instructions in this list. |
toArray | public AbstractInsnNode[] toArray()(Code) | | Returns an array containing all of the instructions in this list.
an array containing all of the instructions in this list. |
|
|