Package EDU.purdue.cs.bloat.editor
Class IncOperand
- java.lang.Object
-
- EDU.purdue.cs.bloat.editor.IncOperand
-
public class IncOperand extends java.lang.ObjectIncOperand 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 Summary
Constructors Constructor Description IncOperand(LocalVariable var, int incr)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intincr()Get the amount to increment by.java.lang.StringtoString()Convert the operand to a string.LocalVariablevar()Get the local variable to increment.
-
-
-
Constructor Detail
-
IncOperand
public IncOperand(LocalVariable var, int incr)
Constructor.- Parameters:
var- The local variable to increment.incr- The amount to increment by.
-
-
Method Detail
-
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 java.lang.String toString()
Convert the operand to a string.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the operand.
-
-