Class ListIndexedIterating.ForLoop

  • Enclosing class:
    ListIndexedIterating

    static class ListIndexedIterating.ForLoop
    extends java.lang.Object
    represents a for loop
    • Field Detail

      • loopStart

        private int loopStart
      • loopEnd

        private int loopEnd
      • loopReg

        private int loopReg
      • loopRegLoaded

        private boolean loopRegLoaded
      • loopCollectionItem

        private edu.umd.cs.findbugs.OpcodeStack.Item loopCollectionItem
    • Constructor Detail

      • ForLoop

        public ForLoop​(int start,
                       int end,
                       int reg)
        constructs a for loop information block
        Parameters:
        start - the start of the for loop
        end - the end of the for loop
        reg - the loop register
    • 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
      • 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