Class IncOperand

java.lang.Object
EDU.purdue.cs.bloat.editor.IncOperand

public class IncOperand extends Object
IncOperand encapsulates the operands to the iinc instruction. It is necessary because the iinc has two operands: a local variable and an integer by which to increment the local variable.
  • Constructor Details

    • IncOperand

      public IncOperand(LocalVariable var, int incr)
      Constructor.
      Parameters:
      var - The local variable to increment.
      incr - The amount to increment by.
  • Method Details

    • var

      public LocalVariable var()
      Get the local variable to increment.
      Returns:
      The local variable to increment.
    • incr

      public int incr()
      Get the amount to increment by.
      Returns:
      The amount to increment by.
    • toString

      public String toString()
      Convert the operand to a string.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the operand.