Class LocalVariable
java.lang.Object
EDU.purdue.cs.bloat.editor.LocalVariable
LocalVariable represents a local variable index operand to various
instructions.
-
Constructor Summary
ConstructorsConstructorDescriptionLocalVariable(int index) Constructor.LocalVariable(String name, Type type, int index) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if an object is equal to this variable.inthashCode()Hash the local variable.intindex()Get the index into the local variable array.name()Get the name of the local variable.toString()Convert the variable to a string.type()Get the type of the local variable.
-
Constructor Details
-
LocalVariable
public LocalVariable(int index) Constructor.- Parameters:
index- The index of the local variable in the method's local variable array.
-
LocalVariable
-
-
Method Details
-
hashCode
-
equals
Check if an object is equal to this variable. A stricter comparison than comparing indices will break Hashtable lookups since a variable could have a name assigned to it after its first use. -
name
-
type
-
index
public int index()Get the index into the local variable array.- Returns:
- The index into the local variable array.
-
toString
-