Package serp.bytecode
Class Code.CodeIterator
- java.lang.Object
-
- serp.bytecode.Code.CodeIterator
-
- All Implemented Interfaces:
java.util.Iterator
,java.util.ListIterator
- Enclosing class:
- Code
private class Code.CodeIterator extends java.lang.Object implements java.util.ListIterator
Helper class to handle invalidation of instructions on removal and notification of modification on addition.
-
-
Constructor Summary
Constructors Constructor Description CodeIterator(CodeEntry entry, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.Object obj)
private void
addInternal(java.lang.Object obj)
boolean
hasNext()
boolean
hasPrevious()
private int
initIndex()
java.lang.Object
next()
int
nextIndex()
java.lang.Object
previous()
int
previousIndex()
void
remove()
private void
replaceTarget(Instruction orig, Instruction replace)
void
set(java.lang.Object obj)
-
-
-
Field Detail
-
UNSET
public static final int UNSET
- See Also:
- Constant Field Values
-
_bn
private CodeEntry _bn
-
_last
private Instruction _last
-
_index
private int _index
-
-
Constructor Detail
-
CodeIterator
public CodeIterator(CodeEntry entry, int index)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator
- Specified by:
hasNext
in interfacejava.util.ListIterator
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interfacejava.util.ListIterator
-
next
public java.lang.Object next()
- Specified by:
next
in interfacejava.util.Iterator
- Specified by:
next
in interfacejava.util.ListIterator
-
nextIndex
public int nextIndex()
- Specified by:
nextIndex
in interfacejava.util.ListIterator
-
previous
public java.lang.Object previous()
- Specified by:
previous
in interfacejava.util.ListIterator
-
previousIndex
public int previousIndex()
- Specified by:
previousIndex
in interfacejava.util.ListIterator
-
initIndex
private int initIndex()
-
add
public void add(java.lang.Object obj)
- Specified by:
add
in interfacejava.util.ListIterator
-
addInternal
private void addInternal(java.lang.Object obj)
-
set
public void set(java.lang.Object obj)
- Specified by:
set
in interfacejava.util.ListIterator
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator
- Specified by:
remove
in interfacejava.util.ListIterator
-
replaceTarget
private void replaceTarget(Instruction orig, Instruction replace)
-
-