Package com.mebigfatguy.fbcontrib.detect
Class ListIndexedIterating.ForLoop
- java.lang.Object
-
- com.mebigfatguy.fbcontrib.detect.ListIndexedIterating.ForLoop
-
- Enclosing class:
- ListIndexedIterating
static class ListIndexedIterating.ForLoop extends java.lang.Object
represents a for loop
-
-
Field Summary
Fields Modifier and Type Field Description private edu.umd.cs.findbugs.OpcodeStack.Item
loopCollectionItem
private int
loopEnd
private int
loopReg
private boolean
loopRegLoaded
private int
loopStart
private ListIndexedIterating.LoopState
loopState
-
Constructor Summary
Constructors Constructor Description ForLoop(int start, int end, int reg)
constructs a for loop information block
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLoopEnd()
get the end pc of the loopint
getLoopReg()
get the loop registerboolean
getLoopRegLoaded()
returns whether the loop register is on the top of the stackint
getLoopStart()
get the start pc of the loopListIndexedIterating.LoopState
getLoopState()
get the current phase of the for loopboolean
isSecondItem(edu.umd.cs.findbugs.OpcodeStack.Item itm)
returns whether this is the second time the loop register is foundvoid
setLoopRegLoaded(boolean loaded)
mark that the loop register has been loaded with an iload instructionvoid
setLoopState(ListIndexedIterating.LoopState state)
sets the current state of the for loop
-
-
-
Field Detail
-
loopStart
private int loopStart
-
loopEnd
private int loopEnd
-
loopReg
private int loopReg
-
loopState
private ListIndexedIterating.LoopState loopState
-
loopRegLoaded
private boolean loopRegLoaded
-
loopCollectionItem
private edu.umd.cs.findbugs.OpcodeStack.Item loopCollectionItem
-
-
Method Detail
-
getLoopStart
public int getLoopStart()
get the start pc of the loop- Returns:
- the start pc of the loop
-
getLoopEnd
public int getLoopEnd()
get the end pc of the loop- Returns:
- the end pc of the loop
-
getLoopReg
public int getLoopReg()
get the loop register- Returns:
- the loop register
-
setLoopState
public void setLoopState(ListIndexedIterating.LoopState state)
sets the current state of the for loop- Parameters:
state
- the new state
-
getLoopState
public ListIndexedIterating.LoopState getLoopState()
get the current phase of the for loop- Returns:
- the current state
-
setLoopRegLoaded
public void setLoopRegLoaded(boolean loaded)
mark that the loop register has been loaded with an iload instruction- Parameters:
loaded
- the flag of whether the loop register is loaded
-
getLoopRegLoaded
public boolean getLoopRegLoaded()
returns whether the loop register is on the top of the stack- Returns:
- whether the loop register is on the top of the stack
-
isSecondItem
public boolean isSecondItem(edu.umd.cs.findbugs.OpcodeStack.Item itm)
returns whether this is the second time the loop register is found- Parameters:
itm
- the item on the stack- Returns:
- whether this is the second time the loop register is found
-
-