Package com.mebigfatguy.fbcontrib.detect
Class ListIndexedIterating.ForLoop
java.lang.Object
com.mebigfatguy.fbcontrib.detect.ListIndexedIterating.ForLoop
- Enclosing class:
ListIndexedIterating
represents a for loop
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate edu.umd.cs.findbugs.OpcodeStack.Itemprivate intprivate intprivate booleanprivate intprivate ListIndexedIterating.LoopState -
Constructor Summary
ConstructorsConstructorDescriptionForLoop(int start, int end, int reg) constructs a for loop information block -
Method Summary
Modifier and TypeMethodDescriptionintget the end pc of the loopintget the loop registerbooleanreturns whether the loop register is on the top of the stackintget the start pc of the loopget the current phase of the for loopbooleanisSecondItem(edu.umd.cs.findbugs.OpcodeStack.Item itm) returns whether this is the second time the loop register is foundvoidsetLoopRegLoaded(boolean loaded) mark that the loop register has been loaded with an iload instructionvoidsets the current state of the for loop
-
Field Details
-
loopStart
private int loopStart -
loopEnd
private int loopEnd -
loopReg
private int loopReg -
loopState
-
loopRegLoaded
private boolean loopRegLoaded -
loopCollectionItem
private edu.umd.cs.findbugs.OpcodeStack.Item loopCollectionItem
-
-
Constructor Details
-
ForLoop
public ForLoop(int start, int end, int reg) constructs a for loop information block- Parameters:
start- the start of the for loopend- the end of the for loopreg- the loop register
-
-
Method Details
-
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
sets the current state of the for loop- Parameters:
state- the new state
-
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
-